Society of Robots - Robot Forum
Software => Software => Topic started 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
-
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.
-
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.
-
I think I'll try the software UART with same pin rx/tx.
I'll update when I have some results.
Thanks guys!
Theo
-
Did you get to configure it? I'm working with the same sensor/Axon II right now.