Shop OBEX P1 Docs P2 Docs Learn Events
basic stamp speedometer help. — Parallax Forums

basic stamp speedometer help.

sevansrpmsevansrpm Posts: 1
edited 2013-06-21 08:15 in BASIC Stamp
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

  • Mike GreenMike Green Posts: 23,101
    edited 2013-04-05 12:08
    Have you installed a copy of StampPlot (see Parallax's Stamp software download page) on your PC? The program you've shown depends on that. The program has stopped at a DEBUGIN statement waiting for information from the PC (from StampPlot). Look at the StampPlot manual as well as the "Basic Stamp Syntax and Reference Manual" and "What's a Microcontroller?", both downloadable from Parallax's Downloads page. These will show you what the various statements do and are full of examples of how to do things with the Stamps.
  • davejamesdavejames Posts: 4,047
    edited 2013-04-05 12:09
    Hello sevansrpm - welcome to the Forum!

    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.
  • stamptrolstamptrol Posts: 1,731
    edited 2013-04-05 12:12
    Welcome to the Forums

    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,
  • edited 2013-06-21 08:15
    Hi sevansrpm- It's probably safe to assume you have already finished this project. Here is a paper that was written up for my Fall quarter project. You may not have any need for it now, however someone searching the forum may. For what it's worth, here you are. http://www.orangelinesolutions.com/postings/pdf/BicycleSpeedometer.pdf -Patrick
Sign In or Register to comment.