This is because the Wire library assumes a perfect bus. Because the I2C cable was longer than a few feet, the normal Wire library that BlinkM_funcs.h uses to communicate with BlinkMs couldn’t be used. It’s still a work in progress, but it can write data pretty successfully and do it over longer cables than normal.įor the VIMBY/Scion Hackerspace Challenge, I created an array of BlinkM MaxM-powered accent lights for the device we made. which will change with the interrupt.Ever wanted to use any pair of pins for I2C on Arduino, not just the dedicated pins on Analog 4 & 5? Me too, so I made a quick little Arduino library called “SoftI2CMaster”, available in the “blinkm-projects” Googlecode repository. const int Button = 2 //Button is on Digital pin 2 volatile boolean Toggle //Introduce the controlling switch. int potpin = 0 // analog pin used to connect the Joystick int val // variable to read the value from the analog pin const int grnLEDpin = 12 //green LED is on Digital pin 12 const int redLEDpin = 13 //red LED is on Digital pin 13. LEDs are used to indicate theĬonst int address = 4 //The address for communications note that // this is one of the dedicated I2C connections. New uploads seeing as it is using Serial and I2C communication that This is included so that the sketch can be stopped to allow This sketch also includes an interrupt button to enable and disable The slave Arduino will take that information and This one is the master and will read a single channel fromĪnalogue pin 0, and send the data to a slave Arduino via the I2CĬommunication. This sketch is one of two for sending information between twoĪrduinos.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |