pramode_ce (pramode_ce) wrote,
pramode_ce
pramode_ce

The Song of the FreeBird!

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);
        }

      
}
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 22 comments