Putting robotics at your service™

Free shipping on orders over $75

Sample code for Ping sensor.

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 4 posts ]

Veteran ( offline )
Posts: 126
Posted: 2006-03-09 00:24 
Im trying to get my ping sensor to work with my BS2 but the sample code that was included with the sensor doesnt work. It keeps giving me syntax errors when it should be. Does anyone have some working code that I could try out just to make sure the sensor it working right?

If it aint broke, your not trying.

Guru ( offline )
Posts: 1660
Posted: 2006-03-09 19:09 
Did you try using this?


(the zip file near the bottom)

If that's not working, make sure that your declarations in the begining are correct.

I believe that the correct declaration for the regular Stamp 2 is:
 {$Stamp BS2}
{$PBasic 2.5}

If that's not working... well I can't help.

Disclaimer: The above person does not claim to have knowledge pertaining to the following subject: anything. Thus, said person may not be held liable for any mishaps/explosions that his advice incurs.

Veteran ( offline )
Posts: 126
Posted: 2006-03-11 23:22 
Thats the same code that came with the ping. But for some reason it works and the stuff that came with it doesnt. Weird, thanks for the post.

If it aint broke, your not trying.

User avatar
Guru ( offline )
Posts: 3578
Posted: 2006-05-03 15:42 
That is weird. can you post the code that came with the ping? There has got to be something missing or a character that is out of place some where in the code.


The robotics nut.


All times are UTC - 5 hours [ DST ]. It is currently 2015-09-03 06:51
Feedback Form