Asked
— Edited
Is there a way to control the color over time or change color of the led due to an event thru some kind of scripting?
Upgrade to ARC Pro
Get access to the latest features and updates with ARC Early Access edition. You'll have everything that's needed to unleash your robot's potential!
Based on your post activity, we found some content that may be interesting to you. Explore these other
tutorials and community conversations.
For instance, if to turn it red you need to use the code WriteI2C(0x43, 0, 255, 0, 0) use a little piece of code like
Code:
Do the same for other colours and shades etc. then call them in the script. Picking a random colour would be as easy as using the random number functions and an if elseif to pick the colour based on the random number (I don't have ARC open and don't know the code for random numbers but it's in there somewhere I'm sure).
P.S. Don't use that code, if it's right it is the biggest coincidence ever.
NEED to check if it fits in my design,and i just got a order from sparkfun,i guess need to order again
Throw the questions up as and when and I'll help where I can.
AT least so far it is,even mel (moviemaker) a non programmer is getting the hang of it and me i thought it was hard too,till tried it.
But still go to have other lke RICH to help us out in some codes we are are stuck on .
i wounder if there is a book on doing scripting,lke the book i got for LISPWORKS a very high powerful AI software i am starting to get good at,if stuck my AI group i am in someone always there to help me.
I2C is mostly the hardest so far for me,need to read up on it
RICH on the I2C script you made,dont you need to first set the address of blinkm first ,before a white command, in case there are 2 on the same buss line
I2C is difficult as it varies so much and without the correct details devices can be almost impossible to write to, I had an I2C LCD Display but couldn't get the datasheet for love nor money and therefore couldn't get it to display text at all, playing with some code I found for other microprocessors and controllers helped a little but all it really did was turned on the backlight, flashed the cursor and moved the cursor to the right... Pretty useless really and certainly not what I needed it to do. Needless to say the LCD display is now in a landfill site somewhere.
Having a (very) quick look at the BlinkM Datasheet the commands should look something like;
Code:
The c and n may need to be like 'c' and 'n', I'm unsure. And they are case sensitive as a C command looks like it'll go to a random RGB colour.
Although that may be wrong, like I said it was a very quick look at the datasheet and I don't understand I2C enough to be confident enough in my interpretation.
However, if it does get too complicated you could always add the BlinkM control to ARC and use ControlCommand to control the BlinkM control through EZ-Script.
I found out is hard to write the code for I2C buss
on that display you couldnt get working it kinda easy to get info on it,if there is a chip #,i forgot the most common chip used for lcd displays using I2C buss ,and then from there can find another display that uses the chip and get the I2C buss info.
Called backwards or reverse engineering,i do it alot at work from other designs others make ,not lcd
but electronic testers,from my head i know most circuit and how they are design along with photographic electronic memory i have.
I2C is as easy or as hard as the I2C device and documentation allows it to be. Poorly documented I2C devices are a nightmare and near impossible to use but well documented devices like the BlinkM look simple to use.
For the right I2C code you need the main chip # a nd then the code for it kinda easy to find it,i done it many times ,not yet on LCD only because i dont use them,i buy a lot of surplus stuff and none can get a data sheet on it,with reverse engineering able to use it,and using good test equipment too
But they are cheap about $10,
The only information I could find is here
There are a few other forum topics about it that I found when searching but nobody could get close to having it usable in ARC/EZ-Script. Feel free to try though, I'm sure more will attempt it as it's the cheapest LCD out there (and now I know why).
I HAVE lcd that uses that same chip and with data for it too,with I2C commands
havent tried it with LCD yet since havent use one ,but other stuff yes it works.
The chip has the commands built-in ,and you cant program it,its same for any lcd,commands are always the same,they dont change from one company to another.
If its using a microprocessor then its different,they change from company to company.
At my company besides electronics designer i am one of the best troubleshooter.
Sleep(5000)
I2CWrite(0,0x09, c, 0xc4)
What happens is I have to move the sliders to change the color, then execute script, the first line is ignored then it changes to the second color. Its almost as if the Blink M control panel is over riding with the first color and the script picks up the second color.