Shop OBEX P1 Docs P2 Docs Learn Events
Reading a pulse signal with the BS2. — Parallax Forums

Reading a pulse signal with the BS2.

ihmechihmech Posts: 179
edited 2009-12-16 01:03 in BASIC Stamp
I am working on a project that is slowly progressing well.· I am still very much a novice, but I am having a blast learning!

Part of my project involves taking a reading of a pulse signal and needing to store it in memory for future use.

My first question is:· Can the BS2 read a pulse signal and then with a user input, store the pulse signal reading in memory?

My other question is:· If the first question is possible, can the BS2 take the reading that was stored in memory and output that same signal to a device until a user·input·stops the output of the signal.

I'm not sure·exactly how to do this, but I have ordered a Professional Development Board to make my experiments easier to do.· I have gotton some ideas form Stamp Works and would appriciate any help or ideas anyone would have.· Thanks!!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-16 01:00
    The BS2 usually measures an input pulse using the PULSIN statement which waits for the leading edge, times the pulse, then returns a number that corresponds to the pulse width when the pulse ends. For the BS2, the units for the measurement is 2us. For other Stamp models, the units may be different. The Manual and the Stamp Editor help files give the details.

    You can write a number, like the output of a PULSIN statement, into the EEPROM used for the program. The READ and WRITE statements do the work. Read the Manual or the help files for details on how to use these statements.

    Once you've measured a pulse and recorded the pulse width, you can use a PULSOUT statement to output a similar pulse on the same or another I/O pin. Again, read the Manual for a description of how the statement works.
  • ihmechihmech Posts: 179
    edited 2009-12-16 01:03
    Thanks Mike! That gets me started, time for some experimenting!
Sign In or Register to comment.