Putting robotics at your service™

Free shipping on orders over $200

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?

http://www.parallax.com/detail.asp?product_id=28015

(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:
Code:
 {$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.

_________________
Mike

The robotics nut.


 

All times are UTC - 5 hours [ DST ]. It is currently 2014-11-01 06:19
Feedback Form
Feedback Form