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

PENGUIN ROBOT Transformer Frog - the Code

HumanoidoHumanoido Posts: 5,770
edited 2007-12-22 01:18 in Robotics
Title: Penguin Transformer Frog
Code Name: penguin_transformer_frog.bpx
Purpose: Penguin Transforms Into a Frog


Here's some unique holiday fun!
This code transforms Penguin robot into a frog!
Hide Penguin bot behind the furniture and the
random intermittent croaking will drive someone crazy
who will search for the sound that appears to come
from everywhere! It's all in fun for the holiday season!

humanoido

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

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

' The number displayed on the debug screen is the approximate number
' of seconds that Penguin will sleep before awaking to croak.
' The comment in the Snooze subroutine tells you how to increase
' nap time and the delay between croaking. 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.

' The frog 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.

' Here's a readout, in seconds, of a typical program run. It shows
' the amount of snooze time in between croaks. 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 croak
' 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.
Sign In or Register to comment.