basic stamp speedometer help.
sevansrpm
Posts: 1
I am a senior taking the PLTW courses through my highschool and as a capstone project I am designing a speedometer for a longboard. I have a very small knowledge of programming and was planning on adapting a program that I found in a process control pdf. Right now I have tested all of the parts on the circuit that I built as shown below, however the program doesn't run and doesn't record any data. If anyone could give me some help or advice on what I should do that would be awesome. I have attached a file that includes schematics for building the circuit was well as the program designed for it. I also wrote in red where the program stops working. Once again I am not the best programmer so I may just be missing some small thing. Any help is appreciated.
Comments
The line where you commented that "the program stops working here" contains a DEBUGIN statement that will open a debug window, and then wait for an entry for variable SP_Data. Is that what you want? The majority of other debug statements appear to be oriented toward StampPlot.
And what do you mean by "the program stops working here"?
...ah, I see that Mr. Green has entered the fray - I'm bowing out.
Well, the principles involved are very simple.
From experience, the first step would be get a reliable signal off the board wheel. Did you compensate for the fact the demo circuit uses a fan motor running at several hundred or thousand rpm's. What have you done to make the board wheel generate a similar number of pulses?
I'd scrap all the code related to plotting with StampPlot. Use the code in the actual measuring part and get it working first.
Here's the general idea. You will have to add the variable declarations before this code will work.
ReadTach:
COUNT Opto_SW,SP_Data,Opto_Count ' Measure counts per unit time
TOGGLE Sampled ' Toggle LED to show sample done
RPM = Opto_Count * (60000 / SP_Data) / CyclesPerRev ' Calculate RPM
Debug dec5 RPM, cr
goto ReadTach
Once you can read the sensor properly, you can pretty it up.
Cheers,