Project help, ColorPAL code integration
M.W.
Posts: 8
Hey Forum,
I am working on my final project using a BS2, Propeller Servo Controller and ColorPAL. I found a piece of starter code that is exactly what I am trying to do, but it's designed for a different color sensor (Taos). I have been trying to rewrite the code so that it will use the ColorPAL instead but I am having no luck. I was hoping that someone who knows more about this could tell me what I am doing wrong. I am attaching the code that I am using. Props to the people who originally wrote it.
Also, slightly disappointed with the ColorPAL's sensor range, only about half an inch... but we work with what we have right?
Anyway, thanks in advance!
EDIT: Forgot to say what the code does. It's supposed to control a robotic arm that picks up colored blocks from one location and sorts them by color into cups.
EDIT2: Posted code updated thanks to PhiPi's recommendation. TY!
Post Edited (M.W.) : 3/4/2010 5:44:39 AM GMT
I am working on my final project using a BS2, Propeller Servo Controller and ColorPAL. I found a piece of starter code that is exactly what I am trying to do, but it's designed for a different color sensor (Taos). I have been trying to rewrite the code so that it will use the ColorPAL instead but I am having no luck. I was hoping that someone who knows more about this could tell me what I am doing wrong. I am attaching the code that I am using. Props to the people who originally wrote it.
Also, slightly disappointed with the ColorPAL's sensor range, only about half an inch... but we work with what we have right?
Anyway, thanks in advance!
EDIT: Forgot to say what the code does. It's supposed to control a robotic arm that picks up colored blocks from one location and sorts them by color into cups.
EDIT2: Posted code updated thanks to PhiPi's recommendation. TY!
Post Edited (M.W.) : 3/4/2010 5:44:39 AM GMT
Comments
First, the SEROUT part only needs to be done once, at the beginning of your program. This programs the ColorPAL to send color data continuously, so it doesn't need to be repeated each time you want to get a sample.
Next, your DO .. LOOP construct will never exit, so your subroutine will never return. You don't need the loop there at all.
'Hope this helps. Good luck with your project!
-Phil
Thank you!
Here's the problem I think I'm having, I think the ColorPAL is not coming on at all. I have tried putting the SEROUT command in multiple places, but the LED never turns on inside as it tries to sample the color. The servo controller seems to work, as do the servos. I think right now the only thing holding me up is that ColorPAL. I am going to search for more documentation but if anyone has any pointers that would be great.
Also, I don't see a command that lets me step through my code [noparse][[/noparse]to see if I am ending up in an endless loop or something] for the stamp editor that Parallax provides. Is it there and I don't see it or should I try a different compiler?
-Phil
Thank you for your continued help Phil, seems you're the resident expert on ColorPAL. I noticed your name in some of the sample code that Parallax provides, pretty cool [noparse]:)[/noparse] So I will post results tonight. TY again.
Did have a little problem with the weight of the arm vs. servo torque though, but that is something of a different matter.
Thanks for your help! Attached is my final code, some of it has been simply rerouted to make it function more succinctly.