Shop OBEX P1 Docs P2 Docs Learn Events
Freqout,PWM, Infrared — Parallax Forums

Freqout,PWM, Infrared

jj Posts: 1
edited 2005-11-11 17:29 in General Discussion
Hi
I´m playing with javelin stamp and a Sumobot. Right now I´m trying to get the IR to work with javelin..
I´m using the Freqout class for generate the waveform but I don´t understand how I should get it to generate 38.5KHz?
Freqout use the PWM class with the timebase 8.68us and the underlying update method in PWM class only has int as parameter to give the number of 8.68us period. It seems impossible to generate freq as 38.5KHz??

Any suggestions...

/J

Comments

  • JavaPaulJavaPaul Posts: 9
    edited 2005-11-11 04:02
    Hi Jorgen -- I am very much a novice Javelin programmer (I have not received the Javelin Stamp I ordered a few days ago...), but I think you are correct.

    Since Freqout is derived stamp.core.PWM, then the on and off periods for the waveform must be an integer multiple of 8.68us.

    So, the highest possible frequency that can be generated is 1/(2*8.68us) or 57.603 kHz. The next lower frequency would be 28.801 kHz.

    Sorry!

    -- Paul
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-11-11 17:29
    I think this thread http://forums.parallax.com/showthread.php?p=520893 may help.

    It explains how to use the Javelin for IR Distance detection.
Sign In or Register to comment.