Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ping not working #18
I haven't had a chance to document it and it's definitely a work in progress, but if you're feeling adventurous :)
(note, I only know how to walk you through on a Mac)
If Arduino IDE is open, quit!
# Get yourself into this directory... cd /Applications/Arduino.app/Contents/Resources/Java/libraries/ # make a backup of the existing Firmata cp -r Firmata Firmata_stable # rm Firmata rm -r Firmata # clone the experimental repo branch git clone git://github.com/jgautier/arduino-1.git Firmata # enter! cd Firmata # get the branch with pulseIn git checkout -b pulseIn origin/pulseIn
Now open the Arduino IDE.
File > Examples > Firmata > Standard Firmata
Once that's loaded into the IDE, confirm it is the correct program by searching for "PULSE_IN"
Compile and upload!
If you receive an error about PULSE_IN not being in scope, then copy this:
#define PULSE_IN 0x74 // send a pulse in command
...and add it below this line:
#define REGISTER_NOT_SPECIFIED -1
Compile and upload to the Arduino. Close the IDE.
EDIT: (adding @korevec's additional instructions)
EDIT: March 2014, the steps below are no longer necessary, as the pulseIn branch ships in master
# Get into johnny-fives node module deps dir cd johnny-five/node_modules # copy the old firmata cp -r firmata/ firmata-npm # clone julian's upstream in place of the old firmata git clone git://github.com/jgautier/firmata.git # enter the repo, create a pulseIn branch and pull julian's pulseIn branch cd firmata && git checkout -b pulseIn && git pull origin pulseIn
Now you should be able to use Ping. Hopefully I haven't missed anything - let me know if I have :)
Also, I'm on IRC/freenode in #robotjs (nick: rwaldron)
I just got this working on a 4 ping sensor ( HC-SR04 ) with directions from @nexxy. Basically, "bridge" the Trigger and the Echo pins. Simply put a jumper wire between these two pins as per (the bridge between 18 & 19) - then the values come through on both the Trigger & Echo, so you can pop either one in the digital out.
Hi there.. I'm working on a Firmata based Arduino project and needed a PulseIn function like you implemented here. Great work. It'd be really nice if this was included in the Standard Firmata release. Any chance you might send them a pull request?
Also, it might be more flexible if trigger and echo lines can be separated; i.e., send echo on one line and read the trigger on a different one. (The user can of course use the same pin if so desired.)
I merged the pulsein changes from https://github.com/jgautier/arduino-1/tree/pulseIn into AdvancedFirmata, so that hopefully we can get all custom functionality into a single place (steppers, pulsein, etc)
For people coming to this issue now (23/07/2013): the master branch of https://github.com/jgautier/firmata works fine, whereas the pulseIn branch does not work at this point in time, so you can ignore the last step of @rwldrn 's instructions (i.e. checking out the
Avoid this altogether with http://www.maxbotix.com/Ultrasonic_Sensors.htm#LV-EZ
referenced this issue
Oct 17, 2013
@felixsanz Looks like gort ships pre-compiled .hex files to be uploaded. I'm sorry if that tool was misleading, I know how awful the feeling of temporary failure can be. Here's my pledge: to avoid this in the future, I'm going to try to find a better way to manage the pulseIn branch of StandardFirmata. Ideally we can do it as a module that can be installed via npm.