Shop OBEX P1 Docs P2 Docs Learn Events
PENGUIN ROBOT Transformer - the Code — Parallax Forums

PENGUIN ROBOT Transformer - the Code

HumanoidoHumanoido Posts: 5,770
edited 2007-10-21 23:04 in Robotics
Penguin Transformer

penguin_transformer_cricket.bpx

With the recent transformers movie, robotics enthusiasts
across the world have raced to mod their robots, creating
transforming capabilities in one form or another! Not wanting
to be left out, Penguin came up with his own idea for turning
into a transformer robot! AND this one is totally hilarious!


Basically, as a practical joke, Penguin thinks it's cool to
hide somewhere (behind the couch) and transform into a
cricket, randomly chirping to drive everyone totally insane!

Here's the plan: while hiding, Penguin bot will use a random
number generator and Virtual Sound Synthesizer to chirp
like a cricket, and do it so randomly in time that locating
the sound will be difficult. He chirps, then naps an
unpredictable time, wakes up, chirps again, then repeats
the process!

The cricket sounds coming from the peizo speaker are
intentionally selected for volume and frequency to create
a virtual surround sound appearing to come from every
direction.

Transforming into a cricket uses numerous techniques.
The code includes nap, random number generation,
Virtual Sound Synthesizer, virtual surround sound, volume,
timing, frequency, and power consumption reduction (PCR).

humanoido

' Title      Penguin Transformer Cricket
' Code Name  penguin_transformer_cricket.bpx
' Purpose    Penguin Transforms Into A Chirping House Cricket
' Author     humanoido
' Version    1.2
' Begin      03 August  2007
' Update     22 October 2007
' Hardware   Stock Penguin

' Penguin Transformer Series (Cricket)
' Penguin thinks its a big joke to hide behind the couch and
' randomly chirp like a cricket, to drive everyone crazy! Let's hope
' everyone has a good sense of humor!

' The Penguin cricket naps for a random time, then wakes to chirp,
' then falls back to sleep. Just when you think you know where he's
' located, the chirp stops!

' The number displayed on the debug screen is the approximate number
' of seconds that Penguin will sleep before awaking to chirp.
' The comment in the Snooze subroutine tells you how to increase
' nap time and the delay between chirping. A longer random delay will
' only add realism to the effect!

' This program generates random numbers using the incremental seed
' technique, where the low number generated is one and the high
' is 11. This is multiplied by 3 to get the delay in seconds.

' Here's a readout, in seconds, of a typical program run. It shows
' the amount of snooze time in between chirps. The shortest snooze
' time is 9 seconds and the longest is about half a minute.
' Read the programs' comment to change to a longer snooze time for
' a more realistic effect!

' 12  18  24  12  15  18  33   9  27  24  33  18  24  18  33
' 9   27  24  33  18  24  18  33   9  27  24  33  18  24  18

' Power consumption is reduced during snoozing, so Penguin can chirp
' away, probably all night! There is an additional randomness to
' the snoozing which varies with temperature, changes in battery
' voltage, and variations in manufacturing tolerances. So every
' Penguin is unique.

humanoido said...
Both the author of this program and Parallax Inc. assume
no liability for the outcome of running this program! Penguin
robots stepped on and squished like real crickets should be
replaced through the normal Parallax order channels, at the
going rates.
Sign In or Register to comment.