05 May 2010

Multi-Master Arduino Setup using i2c

1 Comment Examples, Physical Computing, programing

I working on a project, I was faced with a challenge of creating a serial bus via multiple Arduino which could communicate with each other. My first intuition, after a little push in the right direction by Tom Igoe, was to create a Master/Slave setup where a Master micro-controller polls all the slave micro-controllers, and dispatches an action. Although this answered one of my question, polling didn’t allow for complete 2-way communication. It tuned out that the answer was mainly an oversight of my interpretation of the Wire documentation.

From Arduino Site:

Wire.begin()
Wire.begin(address)
====
Description
Initiate the Wire library and join the I2C bus as a master or slave.
====
Parameters
address: the 7-bit slave address (optional); if not specified, join the bus as a master.
====
Returns
none

I interpreted this explanation as Wire.begin(SomeAddress) would default as a slave, and not be allowed to be a Master. Being as curious, and stubborn as I typically am, i decided to forget what I thought I was being told, and instead try to break the library, so I could then see where it broke, and attempt to adjust it in a way that better suited my need. Surprise, surprise, it worked, and not need to change anything at all! The address parameter is optional and defaults as a master role if no address is set. However if you do plan on sending messages to the master, you could switch speaker and listener roles via a slaves Wire.onReceive(handler) rather then polling using onRequest(handler). Read more

Popularity: 9% [?]

26 Feb 2010

Update Twitter Status w/ Arduino & Processing

8 Comments Examples, Physical Computing, programing

The next phase of my project was to send the serial communication from my Arduino, over to Processing, which then would formulate a status update based on the button you pressed and send it over to Twitter. I’ve worked with several Twitter API’s in the past, so I decided to go with Twitter4J, the “J” in this case stands for Java, which works perfectly with Processing.

Bellow is an updated version of my previous Arduino coding. I plan on switching the status updating to the Processing side, instead of the Arduino side. If this where to be a real product, it would be easier to download a software update, then to have to reprogram the toy itself. I will add that to my todo list, once i get all the major Read more

Popularity: 11% [?]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes