Recent activity
Subscribe to this feed
todbot replied on November 04, 2009 04:20 to the question "connection to Arduino mega?" in ThingM:
todbot replied on October 24, 2009 02:52 to the problem "Can't scale up BlinkM network." in ThingM:
Hi Will,
Short answer: try smaller pull-up resistors (1.2k) first, then try using an "I2C bus driver" chip.
Longer answer:
At 30 feet, you're approaching the theoretical limit for I2C bus length using standard ribbon cable. Making reliable long I2C busses is a bit tricky. This is because I2C is more sensitive than most protocols to increased bus capacitance. And any time you get a long strands of multiple wires next to each other, they start looking more like a capacitor (what's a capacitor than two pieces of metal separated by a gap)
There's some pretty good discussion of these issues on this page:
http://www.i2cchip.com/i2c_connector.html#Bus%20Pullups%20and%20Drive
Where the main take-away might be: try using smaller pull-up resistors (1.2k) on longer bus lengths.
To really solve the problem, people use "I2C bus driver" chips. These are constant-current sources that are more accurate than a simple pull-up resistor. There are many different vendors of these chips, and they're all about the same. A real-world example of using these chips is Dave Vondle's big BlinkM LED wall:
http://labs.ideo.com/2009/08/19/glass...
For *really* long I2C runs, there are various types of "I2C bus extender" chips. These typically need to go in front of each I2C device, so probably aren't applicable for use with BlinkM. But some of these kinds of devices even do a kind of wire protocol modification to allow I2C to work up to several hundred meters.
todbot replied on October 15, 2009 21:40 to the problem "Sequencer does not work/start on Mac OS X 10.6.1" in ThingM:
todbot replied on October 15, 2009 08:37 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
todbot replied on October 15, 2009 06:36 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
You won't get any response over the serial port, as that command doesn't have any return values. But you should see the BlinkM change to that #FFCC33 color. If the BlinkM is playing its startup script, then you'll need to send the Stop Script command ('o') first. The BlinkMCommunicator byte array for that command would be:
{0x01,0x09,0x01,0x00, 'o'}
assuming your BlinkM is at address 9
todbot replied on October 12, 2009 16:15 to the question "Communicator program will not compile. Help." in ThingM:
todbot replied on October 11, 2009 21:40 to the question "Communicator program will not compile. Help." in ThingM:
Hmm, that's very strange. I just tested compiling BlinkMCommunicator from a fresh download if it, using the Arduino 0017 software on Mac OS X 10.5.8 and Windows XP SP2, with the Arduino board type set to "Arduino Duemilenove or Nano w/ ATmega328". Both compiled the sketch just fine.
Can you give me any more details on your system? Is there anything strange about it? Specifically what version of Windows are you on? Have you been able able to compile any other Arduino sketches? (like the ones in the examples, specifically any of the Wire examples)
Have you been experimenting with I2C/TWI/Wire in another capacity? Have you done anything with your Arduino installation that is different than what the Arduino site says to do?
todbot replied on October 11, 2009 21:21 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
Hi Joseph,
BlinkMCommunicator expects raw bytes to be sent, not ASCII. A BlinkMCommunicator command in the form:
{0x01,0x09,0x04,0x00, 'f',0xff,0xcc,0x33}
is almost exactly the syntax used in C/C++/Java/Processing for how to construct a byte array to send to BlinkMCommuncator.
For instance, in Processing (Java), a completely constructed command and sending it to BlinkMCommunicator via the Serial port object looks like this:
byte[] cmd = { 0x01,0x09,0x04,0x00, 'f',(byte)0xff,(byte)0xcc,(byte)0x33 };
serialPort.write( cmd );
(The "(byte)" is needed to force those values to look like bytes instead of ints because Java has signed bytes)
todbot replied on October 11, 2009 21:10 to the question "Communicator program will not compile. Help." in ThingM:
todbot replied on October 07, 2009 02:39 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
Also, I don't fully grok github, but it looks like madrona's stuff is a downstream fork of atduskgreg's RAD. And his repo has blinkm stuff in it too:
http://github.com/atduskgreg/rad/blob...
todbot replied on October 07, 2009 02:35 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
Ahh, okay, I seem to recall reading about RAD a while back. Pretty cool stuff.
Have you asked the author ("madrona"?) of those files why they were commented out?
If RAD is basically a substitution system for Ruby to C/C++, I can't imagine why it wouldn't work. That is, from what I can tell, it's not re-implementing all the Arduino libraries in Ruby that get converted to C++, but rather doing a kind of macro substitution. If it's doing more than that, I'd say stay away from it because there's then no way to use the huge number of useful libraries available for Arduino and it would always lag in bug fixes/updates in the core. (I couldn't find where RAD implemented all the Arduino core libraries which is why I assume it's doing a kind of macro substitution, not reimplementation)
todbot replied on October 05, 2009 04:21 to the question "How to increase BlinkMSequencer time line from 120sec. to 1 hour?" in ThingM:
The "numSlices" variable in BlinkMSequencer reflects the hardware limit in BlinkM of the maximum number of light script commands a light script can have. You cannot make it larger.
If BlinkMs are being controlled by some external microcontroller (e.g. Arduino), there is no limit on the length of the light pattern loop, as the microcontroller can act as the conductor. For BlinkMs playing a stored light script (as what the BlinkMSequencer is really for), then the maximum time a light script can be is about 6.8 minutes.
The user-modifiable light script slot is 48 steps long. Each step is a different BlinkM command. And each step can last for 255 "ticks" in duration. A tick is 1/30th of a second. Thus the maximum time for a single step is 8.5 seconds, and the maximum time for and entire script is around 6.8 minutes.
todbot replied on October 05, 2009 04:14 to the question "Controlling the BlinkM with RAD, has this been done properly?" in ThingM:
todbot replied on September 23, 2009 15:40 to the problem "My BlinkM has died, in mysterious circumstances" in ThingM:
todbot replied on September 20, 2009 07:28 to the question "Rotarty switch to change scripts" in ThingM:
todbot replied on September 19, 2009 18:31 to the question "Rotarty switch to change scripts" in ThingM:
Hi Alex,
Rotary switches can be a bit tricky. And they eat up a lot of inputs. Below is a diagram of a hypothetical 5-position rotary switch hooked up to an Arduino. Connect the rotary's common connection to ground, and then hook each position connection to an Arduino input. You'll need to then either wire a resistor from each position connection to +5V or turn on the internal pull-up resistors of Arduino in your sketch.

With the above circuit, a sketch to test it out would look like the below. In setup() I turn each pin into an input and turn on the internal pull-up resistor (so you don't need the external resistors shown in the diagram). There's also a function called getRotaryValue()that you can use to get back a value that indicates the position of the rotary switch. Then you can do if() statements off that and do whatever you want. In this case, I have it printing to the serial port, but you can add the appropriate BlinkM commands you want.
// RotarySwitch.pde -- test out a rotary switch (not a rotary encoder)
// Tod E. Kurt, http://todbot.com/blog/
const int firstRotaryPin = 3;
const int lastRotaryPin = 6;
void setup() {
for( int i=firstRotaryPin; i<= lastRotaryPin; i++) {
pinMode( i, INPUT);
digitalWrite( i, HIGH); // turn on internal pullup resistor
}
Serial.begin(9600); // let's talk to the world
Serial.println("RotarySwitch ready!");
}
// returns the position of the rotary switch, 1-5
// or returns 0 if no rotary switch is hooked up
int getRotaryValue() {
for( int i=firstRotaryPin; i<= lastRotaryPin; i++) {
int val = digitalRead( i ); // look at a rotary switch input
if( val == LOW ) { // it's selected
return (i - firstRotaryPin + 1); // return a value that ranges 1 - 5
}
}
return 0; // error case
}
void loop() {
int rotaryPos = getRotaryValue();
if( rotaryPos == 1 ) {
Serial.println("Rotary Position 1");
}
else if( rotaryPos == 2 ) {
Serial.println("Rotary Position 2");
}
else if( rotaryPos == 3 ) {
Serial.println("Rotary Position 3");
}
else if( rotaryPos == 4 ) {
Serial.println("Rotary Position 4");
}
else if( rotaryPos == 5 ) {
Serial.println("Rotary Position 5");
}
else {
Serial.println("uh oh, somethings wrong");
}
delay( 100 ); // slow down the loop() so we don't spam the serial port
}
todbot replied on September 16, 2009 06:08 to the question "Compiling BlinkMSequencer for Ubuntu 9.04" in ThingM:
Hi! BlinkMSequencer is a Processing sketch. Download Processing from http://processing.org/ then open up the BlinkMSequencer.pde in Processing. Press the "Run" button to run it from within Processing, and then go to File->Export Application to build a stand-alone app.
todbot replied on September 08, 2009 20:22 to the question "Scripting for dummies" in ThingM:
Hi Alex,
The code snippets in the BlinkM datasheet are just portions of a more complete Arduino sketch. All Arduino sketches must have a "setup()" and "loop()" code blocks, which you'll notice the code snippets lack.
To then the example you list into a full Arduino sketch, it would look something like this:
#include "Wire.h"
void setup() {
Wire.begin(); // set up I2C
Wire.beginTransmission(0x09);// join I2C bus, to BlinkM 0x09
Wire.send('f'); // ‘f’ == fade to color
Wire.send(0xff); // value for red channel
Wire.send(0x00); // value for blue chan.
Wire.send(0x00); // value for green chan.
Wire.endTransmission(); // leave I2C bus
}
void loop() {
}
Notice that the "#include" is outside the "setup()" block. Of course that sketch probably won't do what you want because it doesn't first stop the playback of the startup script a BlinkM normally plays when it's powered on. So a sketch that does that would look like:
#include "Wire.h"
void setup() {
Wire.begin(); // set up I2C
Wire.beginTransmission(0x09);// join I2C bus, to BlinkM 0x09
Wire.send('o'); // 'o' == stop script
Wire.endTransmission(); // leave I2C bus
Wire.beginTransmission(0x09);// join I2C bus, to BlinkM 0x09
Wire.send('f'); // ‘f’ == fade to color
Wire.send(0xff); // value for red channel
Wire.send(0x00); // value for blue chan.
Wire.send(0x00); // value for green chan.
Wire.endTransmission(); // leave I2C bus
}
void loop() {
}
You can see this is starting to get a little ungainly with just using the Wire library. That's why there's the "BlinkM_funcs.h" library you place in your sketch directory. The equivalent sketch using BlinkM_funcs.h would look like:
#include "Wire.h"
#include "BlinkM_funcs.h"
const int blinkm_addr = 0x09;
void setup() {
BlinkM_begin();
BlinkM_stopScript( blinkm_addr );
BlinkM_fadeToRGB( blinkm_addr, 0xff,0x00,0x00 );
}
void loop() {
}
Now if you have your BlinkM plugged in directly to the Arduino (instead of into a breadboard), you will have to change "BlinkM_begin()" to "BlinkM_beginWithPower()" so that the Arduino knows to turn two of its pins into a power source for BlinkM. That sketch would look like:
#include "Wire.h"
#include "BlinkM_funcs.h"
const int blinkm_addr = 0x09;
void setup() {
BlinkM_beginWithPower();
BlinkM_stopScript( blinkm_addr );
BlinkM_fadeToRGB( blinkm_addr, 0xff,0x00,0x00 );
}
void loop() {
}
For another short example, check out the BlinkMColorFader Arduino sketch in the BlinkM Examples bundle.
todbot replied on September 05, 2009 17:46 to the question "Saving sequencer scripts to a file (?)" in ThingM:
todbot replied on August 18, 2009 07:23 to the question "How to get BlinkM color values with RXTX Java lib ?" in ThingM:
| next » « previous |
Loading Profile...



