basic stamp with hall sensor
Hello
I'm working on a little project with a bs2 and a Melexis 90217 Hall-Effect Sensor
<!-- unit price -->But it doesn't work.
Here is the program whats wrong???<!-- unit price -->
' {$STAMP BS2}
Hall· VAR· Word
RPM·· VAR· Word
Hallsensor:··············· 'label
COUNT 5,1000,Hall········· 'tellen pulsen hall sensor opslaan als variabel
RPM= Hall * 60············ 'Variabel= hall(var) * 60 (*60 om per minuut te zetten)
again:···················· 'label
INPUT 14·················· 'klem 14 als ingang
IF IN14 = 1 THEN lcd······ 'als 14 hoog is dan gaat toerental weergegeven worden
IF IN14 = 0 THEN again1··· 'als 14 laag is dan gaat hij eerst de lcd clearen en dan de stand v/d schakelaar checken
lcd:······················ 'label lcd
SEROUT 15, 32, [noparse][[/noparse]12]······· 'clearen display op klem 15
PAUSE 100················· 'pauze
SEROUT 15,32, [noparse][[/noparse]RPM]···· 'toerental weergeven
PAUSE 100················· 'pauze
GOTO again:··············· 'terug controleren of de schakelaar 0/1 geeft
again1:··················· 'label
SEROUT 15, 32, [noparse][[/noparse]12]······· 'clearen display op klem 15
GOTO again················ 'ga naar label again
GOTO Hallsensor
END
I'm working on a little project with a bs2 and a Melexis 90217 Hall-Effect Sensor
<!-- unit price -->But it doesn't work.
Here is the program whats wrong???<!-- unit price -->
' {$STAMP BS2}
Hall· VAR· Word
RPM·· VAR· Word
Hallsensor:··············· 'label
COUNT 5,1000,Hall········· 'tellen pulsen hall sensor opslaan als variabel
RPM= Hall * 60············ 'Variabel= hall(var) * 60 (*60 om per minuut te zetten)
again:···················· 'label
INPUT 14·················· 'klem 14 als ingang
IF IN14 = 1 THEN lcd······ 'als 14 hoog is dan gaat toerental weergegeven worden
IF IN14 = 0 THEN again1··· 'als 14 laag is dan gaat hij eerst de lcd clearen en dan de stand v/d schakelaar checken
lcd:······················ 'label lcd
SEROUT 15, 32, [noparse][[/noparse]12]······· 'clearen display op klem 15
PAUSE 100················· 'pauze
SEROUT 15,32, [noparse][[/noparse]RPM]···· 'toerental weergeven
PAUSE 100················· 'pauze
GOTO again:··············· 'terug controleren of de schakelaar 0/1 geeft
again1:··················· 'label
SEROUT 15, 32, [noparse][[/noparse]12]······· 'clearen display op klem 15
GOTO again················ 'ga naar label again
GOTO Hallsensor
END
Comments
First, you should attach code rather than just pasting it as it looses formatting.
You should also be more specific in your questions - however, what I can see is:
The line 'GOTO Hallsensor' is unreachable, thus the sensor is only read once at the beginning of the code. Maybe
removing that second 'GOTO again' before 'GOTO Hallsensor' will do.
Regards
Adrian