The Song of the FreeBird!

2007-10-07T17:22:00

Visit the Bird's Home! See the bird in action! (Google video) The board is running on a single 9V `Energizer' (similar to Duracell) battery. It works even when the voltage drops to about 7.7V! Some u-boot environment variables have been set so as to make it boot from the SD card and run an init script which loads the PWM driver and sings the following song:


#include "robolib.h"
#include <stdlib.h>

main()
{
        int i;
        robo_init();
        enable_motor(0);
        enable_motor(1);

        while(1) {
                i = 1 + (int)((4.0 * rand())/(RAND_MAX + 1.0));
                if(i == 1) {
                        forward();
                        sleep(3);
                }
                else if(i == 2) {
                        backward();
                        sleep(3);
                }
                else if(i == 3) {
                        left_turn();
                        sleep(1);
                }
                else if(i == 4){
                        right_turn();
                        sleep(1);
                }
                stop();
                sleep(1);
        }

}

Gagan B. Mishra

Thu Dec 27 13:05:57 2007

I thought you were talking about the 'Free Bird' song by Lynyrd Skynyrd ;)


Pramode C.E

Sat Dec 29 03:55:52 2007

This is a totally different FreeBird!


Mike

Thu Dec 24 17:24:46 2009

Looking at your code, I don't see any music functions -- just motion function. I was going to suggest utilizing various music scales, but it appears that your freebird sings without any sound.

[Subscribe to our Newsletter] [Go to pramode.net home] [Courses at Recursive Labs] [Connect with me on Twitter/Facebook]