Society of Robots - Robot Forum

Software => Software => Topic started by: teoxan on June 10, 2010, 06:57:35 AM

Title: Colorpal sensor and Axon2
Post by: teoxan on June 10, 2010, 06:57:35 AM

Hi,

I recently purchased the ColorPal sensor from Parallax http://www.parallax.com/Store/Sensors/ColorLight/tabid/175/CategoryID/50/List/0/SortField/0/Level/a/ProductID/617/Default.aspx (http://www.parallax.com/Store/Sensors/ColorLight/tabid/175/CategoryID/50/List/0/SortField/0/Level/a/ProductID/617/Default.aspx), it's a nice color sensor to do some basic color recognition and/or ambient light detection.

This sensor communicates with  simple serial commands, but the issue is that it has only one pin which needs to toggle between send/receive.
According to the instructions datasheet, first we need to set it in "Direct Mode" ( by using high/low on the digital pin) and then send commands to it to start color recognition.

I was thinking of using an I/O in the Axon and use the software UART, but having only one pin for communication I was wondering if i can toggle an I/O pin to be RX and  TX.

Is that possible?

thanks

Theo
Title: Re: Colorpal sensor and Axon2
Post by: Admin on June 12, 2010, 10:08:07 AM
This sounds just like the Ping sonar code in WebbotLib . . . have a look into that and you can probably hack it to do what you want.
Title: Re: Colorpal sensor and Axon2
Post by: Webbot on June 12, 2010, 11:05:03 AM
Unlike the Ping it uses serial data input and output with auto baud detection.
You could try it two ways:
1. Either add the hardware as shown in the WebbotLib for the Dynamixel AX12 servos. This uses a UART tx/rx pins plus a direction pin that connects only one of them at a time to the single serial pin on the device.
2. Or you could try using a software UART and then use the same pin in the MAKE command for both the Tx and Rx pin.
Title: Re: Colorpal sensor and Axon2
Post by: teoxan on June 12, 2010, 05:01:45 PM

I think I'll try the software UART with same pin rx/tx.

I'll update when I have some results.

Thanks guys!

Theo
Title: Re: Colorpal sensor and Axon2
Post by: Japd on August 18, 2011, 09:20:08 PM
Did you get to configure it? I'm working with the same sensor/Axon II right now.