Using Devantech SF02 in Parallax Javelin
onlyro
Posts: 2
Hi,
I am trying to use Devantech SRF02 in my robot loaded with Parallax Javelin.
My teammate found that there is a class called SRF04.java which can be used in order to conveniently communicate between the Javelin and Devantech SRF04, but could not find any corresponding class for SRF02.
Is it possible to modify SRF04.java class or somehow in order to make them compatible?
If so, could any of the experts tell us how to do so?
Thank you.
I am trying to use Devantech SRF02 in my robot loaded with Parallax Javelin.
My teammate found that there is a class called SRF04.java which can be used in order to conveniently communicate between the Javelin and Devantech SRF04, but could not find any corresponding class for SRF02.
Is it possible to modify SRF04.java class or somehow in order to make them compatible?
If so, could any of the experts tell us how to do so?
Thank you.
Comments
http://www.robot-italy.com/download/srf02_serial.pdf
shows that you need to setup a serial connection.
static final int pinTX = CPU.pin0;
static final int pinRX = CPU.pin1;
static Uart srfTX = new Uart(Uart.dirTransmit,pinTX,Uart.dontInvert,Uart.speed9600,Uart.stop2);
static Uart srfRX = new Uart(Uart.dirReceive,pinRX,Uart.dontInvert,Uart.speed9600,Uart.stop2);
Then you send commands using srfTX. Each command is two bytes.
The response is received on the rx pin and can be retrieved using sfrRX.
regards peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support