Bluetooth Image Light Writer



Bluetooth, a simple microcontroller, and an RGB LED. I stream image data over to the micro from Processing, so I can change the color in real time, or by a preset image. It pauses after each row, so I can move the writer to a new position if I’d like. I’ll post more when I get better working with it.
//Bluetooth LightWrite —Dylan Moore 2008. Thanks, arduino!
void setup()
{
Serial.begin(9600);
}
int r,g,b;
int incomingByte = 0;
void loop()
{
//PWM:
analogWrite(9,r); //R
analogWrite(11,g); //G
analogWrite(10,b); //B
//Serial.println(“heartbeat”);
if (Serial.available() > 0)
{
incomingByte = Serial.read();
if(incomingByte==255) //this will be the transition number while (Serial.available()<=0);
incomingByte = Serial.read();
r=incomingByte;
while(Serial.available()<=0);
incomingByte = Serial.read(); g=incomingByte;
while(Serial.available()<=0);
incomingByte = Serial.read(); b=incomingByte;
}
}
Posted Dec 9, 08:38 AM by Dylan Moore ·
I2C class notes
Want to get REAL i2c working with arduino?
read morePosted Dec 2, 09:32 AM by Dylan Moore ·
Arduino I2C
First of all: Do not use Wiring. It, while well intentioned, does not do what it should. I have appropriated a chunk of code from the avrlibc library (http://www.nongnu.org/avr-libc/)
read morePosted Nov 23, 06:02 AM by Dylan Moore ·