Reading and storing measurements
WILLQH
Posts: 11
Hii,
·· I·will like to·attach a Sonar sensor to my Basic Stamp controller·to provide distance measurement readings (10 readings per sec) and will like to know how I can read in and·store all these values, and then later on display it so that i can use the values for evaluation. Can someone please show me a sample code to carry out this function.
· In addition, can the controller take in PWM signal ?
Thank you and Merry christmas in advance
Regards
·· I·will like to·attach a Sonar sensor to my Basic Stamp controller·to provide distance measurement readings (10 readings per sec) and will like to know how I can read in and·store all these values, and then later on display it so that i can use the values for evaluation. Can someone please show me a sample code to carry out this function.
· In addition, can the controller take in PWM signal ?
Thank you and Merry christmas in advance
Regards
Comments
·· How many readings are you looking to store?· At 10 per second you could use up a·lot of storage space quickly.· As for the PWM input, it could be read using PULSIN.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
·
Since the Ping))) will return values greater than a byte, I have also attached EepromDataStorageWordValues.bs2, which is a version that stores word values.· It has not been tested, but I'm pretty sure it'll work.· Word size values take up two bytes each, which cuts the number of records you can store in half.
·
You can modify·EepromDataStorageWordValues.bs2 to store Ping))) measurements by replacing the DEBUGIN command in the Record_Data subroutine with a PULSIN command to read the ultrasonic echo time.· Also, remove the DEBUG commands in the Record_Data subroutine's FOR...NEXT loop, and add a PAUSE command that slows down the sampling rate to the 10 samples per second you are looking for.·
·
Post Edited (Andy Lindsay (Parallax)) : 12/21/2005 8:11:47 PM GMT