Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp np timer???? — Parallax Forums

Basic Stamp np timer????

MilevithiusMilevithius Posts: 4
edited 2009-02-22 22:25 in BASIC Stamp
Hello,

I`m currently building a Robot. no problems so far with motion, navigation, and interaction.

Now its is time to get it alive, here goes my question:

I want to create a continous hearth beat. Obviously without affecting its other routine/special activities. For this I was wondering if Basic stamp includes a timer, which could interrupt the program and call one subroutine at regular intervals for a quick Hearth beat in this case. So sort of code : Every 1750 gosub_Hearth once done return to previous function.

The point is that I would like to give some emotions (create dif. moods depending on inputs . ex dark) which would be translated in hearth beating pace.

For now navigation stops for each hearth beat which is quite stupid.

FYI Beat of my Robot.

PULSOUT 9, 32500 ' LED on, duration
FREQOUT 11, 50, 3000 ' Beep, duration, Frequency
PULSOUT 10, 16250 ' LED on, duration
PAUSE 25
FREQOUT 11, 25, 3000 ' Beep, duration, Frequency
PAUSE 1750


If you have any idea how I can eventually implement this in robot go ahead.

I'm also open to building a circuit from scratch. Any idea is more than welcome!

Tks for help and share of thoughts

Comments

  • MSDTechMSDTech Posts: 342
    edited 2009-02-20 18:37
    The BS2 series of microcontrollers do not have a routine interrupt capacity. For what you are trying to do, you might want to look at the SoundPal
    http://www.parallax.com/Store/Robots/RoboticAccessories/tabid/145/CategoryID/22/List/0/SortField/0/catpageindex/2/Level/a/ProductID/482/Default.aspx

    It can produce a sound that continuously repeats until you tell it to stop. You can then give it another repeating sound to play.
  • MilevithiusMilevithius Posts: 4
    edited 2009-02-22 22:12
    Hello thank you for the fast replay and proposition.

    although I'm interested in implementing a hearth beat with light with the opportunity to switch the sound off (for night sleep).

    Do you think the sound pal can be easily modified to attach 2 LEDs ?

    Regards,

    Thanks again.
  • MSDTechMSDTech Posts: 342
    edited 2009-02-22 22:23
    I don't think you can modify the SoundPal to attach LED's. One thing I would suggest for both the sound and LED's. You might look into the SX proto boards. You can build a unit that handles the sound and lights and is controlled by a serial command from the BS2. There are several examples of similar aux controllers in the SX form.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-22 22:25
    No

    The sound pal is not easily modified to be anything other than what the documentation describes. It's physically very small using small, surface mount parts. There's no provision for reprogramming although the microcontroller used can be reprogrammed, there's no wiring or connection for it. Since the ATTiny13 microcontroller is used in several of Parallax's products (like the BS2pe MotherBoard), the development software and some sample code is available from Parallax as well as from the manufacturer. You could probably develop an LED heartbeat device patterned on the sound pal that would do what you want.
Sign In or Register to comment.