The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
I need a little help. I have a BlinkM setup I believe correctly. Here is my code:
byte[] init = new byte[4] {(byte)'c', 0xff, 0xc4, 0x30 };
I2CDevice i2c = new I2CDevice(new I2CDevice.Configuration(0x09, 100));
I2CDevice.I2CTransaction[] xActions = new I2CDevice.I2CTransaction[4]
{
//I2CDevice.CreateWriteTransaction(init)
I2CDevice.CreateWriteTransaction(new byte[] {(byte)'c'}),
I2CDevice.CreateWriteTransaction(new byte[] { 0xff }),
I2CDevice.CreateWriteTransaction(new byte[] { 0xc4 }),
I2CDevice.CreateWriteTransaction(new byte[] { 0x30 })
};
int result = i2c.Execute(xActions, 100);
Which is my translation of this from the blinkM docs:
Wire.begin(); // set up I2C
Wire.beginTransmission(0x09);// join I2C, talk to BlinkM 0x09
Wire.send(‘c’); // ‘c’ == fade to color
Wire.send(0xff); // value for red channel
Wire.send(0xc4); // value for blue channel
Wire.send(0x30); // value for green channel
Wire.endTransmission(); // leave I2C bus
result is returning 1 when I use either the 4 CreateWrieTransactions or the single. It might be the clockRate is bad but I do not know what value to pass.
Any help or suggestions would be appreciated.
Thanks!
I was running into some odd issues too. It turned out to be my pull-up resistors. I guess most people know to double check this, but I figured I suggest it anyway.
Stacy
Thanks Stacy - I'm still very new to the hardware side of all this fun.
The BlinkM doc says this:
In this configuration, power is drawn from the Arduino’s analog in pins 2 & 3, configured via software to act as for BlinkM & BlinkM MaxMpower pins. This does not damage the pins, but does reduce the maximum brightness of BlinkM by about 30%.
How do I configure through software analog pins 2 and 3 to act as power? My first guess was to create an OutputPort for GPIO_PIN_A3 and set its state to true, but that did not work.
It appears there was an AnalogOut but that is not available anymore. Am I missing something?
Thanks Stacy - I'm still very new to the hardware side of all this fun.
The BlinkM doc says this:
In this configuration, power is drawn from the Arduino’s analog in pins 2 & 3, configured via software to act as for BlinkM & BlinkM MaxMpower pins. This does not damage the pins, but does reduce the maximum brightness of BlinkM by about 30%.
How do I configure through software analog pins 2 and 3 to act as power? My first guess was to create an OutputPort for GPIO_PIN_A3 and set its state to true, but that did not work.
It appears there was an AnalogOut but that is not available anymore. Am I missing something?
I'd have to check but the analog pins can only supply 2ma I think vs 16ma from the digital pins. From the tech specs:
max current: 8 mA per pin
digital pins 2, 3, 7: 16 mA per pin
analog pins 0-3: 2 mA per pin
microcontroller max current: 200 mA total
So make sure you can supply enough power for your component off those pins.
Assuming that the analog pin can provide enough power. I still do not know how to configure the analog pin to act as power. My guess now is that this functionality is not part of the Netduino SDK.
Assuming that the analog pin can provide enough power. I still do not know how to configure the analog pin to act as power. My guess now is that this functionality is not part of the Netduino SDK.
Some Arduino extensions will pull a bit of power from the Arduino's pins--which can drive quite a bit of power.
To do this on Netduino, you just create an OutputPort and set the default state to true:
OutputPort power1 = new OutputPort(Pins.XXX, true);
I would generally avoid doing this--and would generally use the 3.3V/5V power headers to supply power to your accessories. But if you need to do it, remember that pins A0-A3 provide 2mA of power, and all other digital pins provide 8mA of power (with the exception of 3 of the digital pins on top--which can provide 16mA).
You probably won't be able to power this particular device off of 2mA of power--so you'll need to use jumper wires and/or a breakboard to pull the power from somewhere else... The lower-power ARM processor isn't really designed for providing power from GPIOs...
static I2CDevice i2c = new I2CDevice(new I2CDevice.Configuration(0, 100));
...
int result2 = i2c.Execute(new I2CDevice.I2CTransaction[]
{
I2CDevice.CreateWriteTransaction(new byte[1] {(byte)'o'})
}, 5000);
When it runs result2 in this case is 1. But no command that I send affects the blinkM.
I also tested HardProvider.GetI2CPins(). The returned pins are not analog 5 and 4. They are digital 10 and 11. But that may mean nothing.
Two quick things:
1. You're sending an 'o' command to the BlinkM, which according to the documentation is a "stop script" command. What other commands have you used?
2. The pin #s returned from GetI2CPins are the actual port pin #s on the Netduino's Atmel ARM MCU. Pins 10 and 11 are SDA/SCL--which correspond to A4/A5 on the Netduino.
Hey Whats up Unless you have changed the location of the BlinkM its should be 0x00 on the i2c bus not 0x09. See if that makes a difference I own one but do not own a netduino
I have just got a BlinkM MinM, and am also having trouble getting it working. I have tried the code that trustme posted with no luck, however I am completely new to C# and was hoping to use netduino as a way of learning it, I have had some experience with vb.net so I am not a complete newbie to programming.
I have just got a BlinkM MinM, and am also having trouble getting it working. I have tried the code that trustme posted with no luck, however I am completely new to C# and was hoping to use netduino as a way of learning it, I have had some experience with vb.net so I am not a complete newbie to programming.
Hi Spike,
Welcome to the community! Can you share how you've wired it up, etc.? Perhaps some members of the community who have used BlinkM's can help spot what's awry?
Spike,
First thing I notice, although this might not be the issue... The 32-bit ARM processor on the Netduino is lower-power than the AVR chip used on the Arduinos. So it only puts out 8mA of power on analog pin 2 (instead of 20mA).
Could you try to connect the + power connection to the 3.3V header instead?
Chris
Ok, now I am having the same problem as trustme, nothing I send effects the LED. The LED continues to cycle through what I presume is the default colour cycle.
Ok, now I am having the same problem as trustme, nothing I send effects the LED. The LED continues to cycle through what I presume is the default colour cycle.
Hmm, what changed?
Perhaps we need to get some of the units in here and create a sort of unofficial driver for them? They seem to be quite popular, and we'd like to help promote hardware from the community...
Well after I attached it to the 3v pin it cycles without having been programmed by me, which it still does, however I cant seem to program it. I would happily have a go at writing a driver, however I don't think I have the C# knowledge to do so, and I lack the hardware knowledge im afraid!
Well after I attached it to the 3v pin it cycles without having been programmed by me, which it still does, however I cant seem to program it. I would happily have a go at writing a driver, however I don't think I have the C# knowledge to do so, and I lack the hardware knowledge im afraid!
Oh, okay... So it looks like things are working but the trouble is changing the program on the BlinkMs...
I would happily have a go at writing a driver, however I don't think I have the C# knowledge to do so, and I lack the hardware knowledge im afraid!
With a name like Spike, I don't think you're afraid of anything
One big question: it looks like you're using I2C to program/control the BlinkM's. I2C is on analog pins 4 and 5. Do you have the data lines plugged into A4/A5--or A0/A1?
Also, do BlinkMs have their own pull-up resistors built-in or do you need to add those?