A small test, mould-making from the lumpy Space Rocks created using Meshmixer, plus the resulting Jesmonite cast.
Tag: prototype
Baby speakers
The tiny audio speakers have arrived. I didn’t realise they would be so small. They are 2W 8 Ohm and 23mm in diameter. And also a little bit quiet.
Demo Show
Some photos from today’s demo show of work-in-progress for We Are Here. Including one working Arduino prototype with sound generator.
Fitting the electronics into the shapes
A rough guide to how all of the required electronics (XBee, Arduino Nano, speaker, sensor and – hopefully – a USB power bank) might fit into the four Space Rock shapes. All items drawn to scale.
Space Rock – latest 3D prints
Some photographs of the latest 3D prints for We Are Here.
Arduino networked lamp test
Working through this tutorial currently, trying to understand how Processing can be used to network an Arduino and power the colour of a lamp from words featured in an XML feed (in this case my blog feed – replacing the word ‘love’ with ‘space’ and the word ‘peace’ with ‘rock’). This generates the colour #3C4C2C.
And after adding this post to the feed…
Note the slight colour change.
This is the circuit I used, from this website. The LED is a 4 pin one, which can generate any combination of RGB colour as light:
And the two versions of it that I built:
Here is the code used in Processing:
//Arduino Code for the Arduino Networked Lamp - Processing
#define SENSOR 0
#define R_LED 9
#define G_LED 10
#define B_LED 11
#define BUTTON 12
int val =0; //variable to store the value coming from the sensor
int btn = LOW;
int old_btn = LOW;
int state = 0;
char buffer[7];
int pointer = 0;
byte inByte = 0;
byte r = 0;
byte g = 0;
byte b = 0;
void setup() {
Serial.begin(9600); //open up serial port
pinMode(BUTTON, INPUT);
}
void loop() {
val = analogRead(SENSOR);
Serial.println(val);
if (Serial.available() >0) {
//read incoming byte
inByte = Serial.read();
if (inByte == '#') {
while (pointer < 6) {
buffer[pointer] = Serial.read();
pointer++;
}
//now need to decode 3 numbers of colors stored as hex numbers into 3 bytes
r = hex2dec(buffer[1]) +hex2dec(buffer[0])*16;
g = hex2dec(buffer[3]) +hex2dec(buffer[2])*16;
b = hex2dec(buffer[5]) +hex2dec(buffer[4])*16;
pointer = 0; //reset pointer
}
}
btn = digitalRead(BUTTON);
//check if there was a transition
if ((btn == HIGH) && (old_btn == LOW)) {
state = 1-state;
}
old_btn = btn; //val is now old,lets store it
if (state == 1) {
analogWrite(R_LED, r);
analogWrite(G_LED, g);
analogWrite(B_LED, b);
}
else {
analogWrite(R_LED, 0);
analogWrite(G_LED, 0);
analogWrite(B_LED, 0);
}
delay(100);
}
int hex2dec(byte c) {
if (c >= '0' && c<= '9') {
return c- '0';
} else if (c >='A' && c <= 'F') {
return c - 'A' + 10;
}
}
And the code in Arduino:
//Arduino Code for the Arduino Networked Lamp - Arduino
#define SENSOR 0
#define R_LED 9
#define G_LED 10
#define B_LED 11
#define BUTTON 12
int val =0; //variable to store the value coming from the sensor
int btn = LOW;
int old_btn = LOW;
int state = 0;
char buffer[7];
int pointer = 0;
byte inByte = 0;
byte r = 0;
byte g = 0;
byte b = 0;
void setup() {
Serial.begin(9600); //open up serial port
pinMode(BUTTON, INPUT);
}
void loop() {
val = analogRead(SENSOR);
Serial.println(val);
if (Serial.available() >0) {
//read incoming byte
inByte = Serial.read();
if (inByte == '#') {
while (pointer < 6) {
buffer[pointer] = Serial.read();
pointer++;
}
//now need to decode 3 numbers of colors stored as hex numbers into 3 bytes
r = hex2dec(buffer[1]) +hex2dec(buffer[0])*16;
g = hex2dec(buffer[3]) +hex2dec(buffer[2])*16;
b = hex2dec(buffer[5]) +hex2dec(buffer[4])*16;
pointer = 0; //reset pointer
}
}
btn = digitalRead(BUTTON);
//check if there was a transition
if ((btn == HIGH) && (old_btn == LOW)) {
state = 1-state;
}
old_btn = btn; //val is now old,lets store it
if (state == 1) {
analogWrite(R_LED, r);
analogWrite(G_LED, g);
analogWrite(B_LED, b);
}
else {
analogWrite(R_LED, 0);
analogWrite(G_LED, 0);
analogWrite(B_LED, 0);
}
delay(100);
}
int hex2dec(byte c) {
if (c >= '0' && c<= '9') {
return c- '0';
} else if (c >='A' && c <= 'F') {
return c - 'A' + 10;
}
}
This didn’t work the first time I ran it, so I had to specify the Arduino port that Processing should use and then…
Latest (simplified) Space Rock sketches and 3D prints
Looking at some shapes that tessellate for the Space Rock 3D models.
Space Rocks – new sketches
Some further sketches for the Space Rock shapes. These based on collages of the original shapes created.
Networked shapes
Some sketches investigating 5 shapes that can fit together into one sculpture.
You must be logged in to post a comment.