Basic Stamp 2 with SensComp 6500
88
Posts: 2
Hi, i'm currently on a project to connect SensComp 6500 ranging module ultrasonic sensors with Basic Stamp 2 which will be interface with LabView.. So far i have managed to obtain data from one ultrasonic sensor.. Below is the source code used:
' {$STAMP BS2}
dist VAR Word ' working variable for distance calculation
ECHO CON 15 ' sonar module echo detection output
INIT CON 14 ' sonar module control input ' 1 starts a measurement ' 0 resets the module
settle CON 1
delay CON 20
convfac CON 29
offset CON 700
loop:
GOSUB sr_sonar
DEBUG DEC dist,CR
PAUSE delay
GOTO loop
sr_sonar:
HIGH INIT
PAUSE settle ' be certain that ECHO is low
RCTIME ECHO,0,dist ' wait for ECHO to go high
LOW INIT ' reset module
dist=(dist+offset)/convfac
RETURN
I was wondering is there any way i can obtain data from 5 ultrasonic sensors instead of only 1??· DO u think i need to make changes in the above source code which will be load into the BS2 through Stamp Editor· or· by making changes to the LabView?· Please reply asap.. Thanks...
' {$STAMP BS2}
dist VAR Word ' working variable for distance calculation
ECHO CON 15 ' sonar module echo detection output
INIT CON 14 ' sonar module control input ' 1 starts a measurement ' 0 resets the module
settle CON 1
delay CON 20
convfac CON 29
offset CON 700
loop:
GOSUB sr_sonar
DEBUG DEC dist,CR
PAUSE delay
GOTO loop
sr_sonar:
HIGH INIT
PAUSE settle ' be certain that ECHO is low
RCTIME ECHO,0,dist ' wait for ECHO to go high
LOW INIT ' reset module
dist=(dist+offset)/convfac
RETURN
I was wondering is there any way i can obtain data from 5 ultrasonic sensors instead of only 1??· DO u think i need to make changes in the above source code which will be load into the BS2 through Stamp Editor· or· by making changes to the LabView?· Please reply asap.. Thanks...
Comments
BS are single task, always thing that you do one thing folowing the other.
Hope to Help
Amaral
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen