Laser Range Finder inerface with Arduino Mega 2560
eagletusk
Posts: 2
Just whipped up an example sketch for the Parallax Laser Range Finder using an Arduino Mega.
https://bitbucket.org/eagletusk/parallax-lrf/(mercurial repo)
Mega used because it has two UARTs, a regular Arduino could be used but you will need to bit bang the second on UART, and that doesn't seem like too much fun. If you are interested please branch and post it.
Many thanks to Mr. Grand and Parallax for developing this range finder.
https://bitbucket.org/eagletusk/parallax-lrf/(mercurial repo)
Mega used because it has two UARTs, a regular Arduino could be used but you will need to bit bang the second on UART, and that doesn't seem like too much fun. If you are interested please branch and post it.
Many thanks to Mr. Grand and Parallax for developing this range finder.
Comments
If you use Arduino 1.0 you can get a non-UART software-based serial on any pin, and it has *almost* the same functionality at 9600 baud as a hardware UART. The new SoftwareSerial in Arduino 1.0 is based on NewSoftSerial, plus has some enhancements (like based on the Stream class, and having selectable listeners). I don't have a laser ranger finder to test, but your sketch should work with an Uno board as well.
Your current sketch can be modified by using Serial.write statements instead of Serial.print, and dropping the BYTE modifier, as it's no longer supported. You probably knew that already, but I thought I'd mention.
-- Gordon
For what it's worth, I've posted some Arduino example code to my Laser Range Finder page. It was written by Roy Eltham and Dino Segovis (makerdino) for Hack A Week episode #13.
Joe