Shop OBEX P1 Docs P2 Docs Learn Events
ColourPAL program — Parallax Forums

ColourPAL program

bwittbwitt Posts: 7
edited 2010-09-08 19:18 in Accessories
:shakehead:
hey guys.
im trying to find out how to use the colour PAL sensor.
I want to develope a robot that can sense a particular colour ( eg blue red green) and have the program activate something such as a servo or LED for example, when it detects the colour specified in the program.
Im not too experienced with parallax, but can do Pbasic programming, and i t would be greatly appreciated if you could help. thanks a lotttttt

BWitt:smilewinkgrin:

PS...Im using the BS2 and board of education
thanks
any reply will help

Comments

  • dandreaedandreae Posts: 1,375
    edited 2010-09-08 07:01
    The Color PAL gives you three values back for RGB, you can use this with the "IF THEN" command and compare the values for each color. This will allow you to perform a certain subroutine for each color detected. Set up the Color PAL and calibrate it and then start taking some readings for RGB using colored paper or objects.

    Dave
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-09-08 07:51
    I just picked up a ColorPAL myself and want to start experimenting with it. Does the object have to be right in front of the lens or can it be farther away? Just curious as to the working range of the sensor.

    Robert
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-08 08:46
    For best results, the subject should be in contact with the snorkel in order to shield the sensor from ambient light and to get the maximum light reflected back from the RGB LED. However, this is not a strict requirement, since an ambient light reading is taken automatically and subtracted from the color readings. Problems can arise, however, if there's a lot of ambient light incursion or if the ambient light is rapidly varying, as would happen with fluorescent room lighting. Barring this, though, if there were a small gap between the snorkel and the subject, it would not matter much. In this situation, you do have to make sure that the distance from the subjects to the snorkel is kept constant; otherwise your color readings will vary with changes in distance.

    -Phil
  • bwittbwitt Posts: 7
    edited 2010-09-08 13:54
    hi dave! that part is the part i get.
    its just the part about how to read the signals that are being sent FROM the PAL to the BS2 that i dont understand.
    how do i identify if the PAL has actually picked u a colour reading, and howto encorporate that readin into the program!!
    thanks!
  • bwittbwitt Posts: 7
    edited 2010-09-08 15:50
    hey guys, it would also be helpful if u could help me understand, or explain to me the file attached to this comment
    thanks
  • FranklinFranklin Posts: 4,747
    edited 2010-09-08 19:18
    Almost EVERY line in that program is commented. What is it you don't understand?
Sign In or Register to comment.