Using a PICAXE chip to control multiple Ghetto Pixels (open source BlinkM)

agroom

New Member
I recently decided to try out making my own Ghetto Pixels, they're an open source version of the BlinkM pixel. I've successfully made 10 ghetto pixels that I'm currently controlling with an Arduino and BlinkM's sequencing software through it's I2C bus as described in the ghetto pixel instructable.

What I'd like to do though is use a PICAXE chip to control the pixels. Ideally I picture coding several sequences for the pixels, storing them on the PICAXE and using a multi-directional switch (or similar device) to cycle through the sequences. This way I can setup the pixels and run light sequences without having to rely on using my Arduino. However, I'm completely new to using I2C and don't know where to begin.

I'm wondering if anyone has done this before and/or has some advice or knows of some starter tutorials to get me going.
 

techElder

Well-known member
Be aware that one of the problems with the "Ghetto Pixels" stuff is that it won't do ALL of the sequence developed in the ThingM sequencer. I found that bit of info in the comment section of that Instructable.

You also have to be aware of current drive limitations of the PICAXE if you are planning to use high current RGB LEDs.
 

agroom

New Member
Have you read the i2c Tutorial?
I have not, thanks! I'll go through that and see if it either makes things more confusing or just raises more questions :)

Be aware that one of the problems with the "Ghetto Pixels" stuff is that it won't do ALL of the sequence developed in the ThingM sequencer. I found that bit of info in the comment section of that Instructable.

You also have to be aware of current drive limitations of the PICAXE if you are planning to use high current RGB LEDs.
Yeah, that's not really an issue. For the price, fun and experience, the limitations are worth it for now. As far as the current goes, I didn't plan on using high current RGB LEDs (at least I don't think they are, standard 20mA/color). But out of curiosity, why would that be an issue? The LEDs are getting current from the 5v source right? A quick look at the link from nick12ab shows the +4.5V rail supplying power to all the pixels as I thought.
 

nick12ab

Senior Member
As far as the current goes, I didn't plan on using high current RGB LEDs (at least I don't think they are, standard 20mA/color). But out of curiosity, why would that be an issue? The LEDs are getting current from the 5v source right? A quick look at the link from nick12ab shows the +4.5V rail supplying power to all the pixels as I thought.
The problem isn't with the power source itself, it is how much current can be safely drawn through a PICAXE I/O pin. There are per-pin limits and per-chip limits. 20mA per pin is typical and 100mA per chip is typical, so for instance you wouldn't be able to power a 500mA LED directly from a PICAXE output pin, you'd need a transistor.
 

agroom

New Member
The problem isn't with the power source itself, it is how much current can be safely drawn through a PICAXE I/O pin. There are per-pin limits and per-chip limits. 20mA per pin is typical and 100mA per chip is typical, so for instance you wouldn't be able to power a 500mA LED directly from a PICAXE output pin, you'd need a transistor.
I'm just running 1 LED to test, so 20mA/color, 60mA total. Plus the Ghetto Pixels are not powered through the PICAXE chip, they're independently powered. The only thing coming out of the PICAXE are the SCL and SDA channels.

Although I'm having some issues and wondering if there's something I'm doing wrong in my code. Here's what I have, and per the BlinkM data sheet should flash white on and off.

Code:
init:
	hi2csetup i2cmaster,1,i2cslow,i2cbyte
	
main:
	hi2cout 1,("n",$ff,$ff,$ff)
	pause 500
	hi2cout 1,("n",$00,$00,$00)
	pause 500
	goto main
 

hippy

Ex-Staff (retired)
hi2csetup i2cmaster,1,i2cslow,i2cbyte
I've not read the datasheet but the I2C Device Address is probably wrong. In binary it should have the value %xxxxxxx0, a 7-bit value multiplied by two to give 8-bits, the lsb zero.
 

agroom

New Member
I've not read the datasheet but the I2C Device Address is probably wrong. In binary it should have the value %xxxxxxx0, a 7-bit value multiplied by two to give 8-bits, the lsb zero.
Yeah, I'm guessing that's my problem too. I had 10 chips that I flashed, all with addresses from 1-10 and set them up on my breadboard. At the time I was using my Arduino and the sequencer program from ThinkM and had them all working, or well, I ran out of resistors for the last few LED's, so like 7 of them working.

Having them hooked to my Arduino and using the app obviously gave me spirit that I was able to successfully flash the chips, wire everything correctly, etc. But this didn't fit my application, so now it was time to see if I can write a program using one of my PICAXE chips to drive them. So I decided to start with 1 pixel and used one of the chips I didn't have resistors for and scrounged up 3 more resistors.

From the PICAXE manual and other code snippets I've found online, I've seen both binary and decimal being used for the address. It seems like when you use decimal though, it recgonizes this and makes the necessary bitshift (multiply by 2), but I could be wrong. I'm actually just going to reflash the chips to get the default address of 0x09 so I know for sure what it is. It's possible when I tried to change the address to 1 it didn't get set, or changed to something entirely different.
 
Top