A Robotics Project Page
Google
 
Web    www.PhilBot.com
My other sites
  • OurCoolHouse
  • Phil's Resume
  • Web Portfolio

  • [Home] [Projects] [Hardware] [Software] [Books] [Links] [Downloads]


    BOB: Software.          [Back to BOB index]

    Now that we have BOB robot hardware, we need software. This is made a lot easier since we are using an "OOPic for Brains".

    In developing BOB's control software I wanted to use the latest "6.0" version of the OOPic compiler.  It's still in Beta release at the time that I'm writing this, but it seems stable enough for BOB.  Since this version of the compiler has a better grasp on the C syntax, these programs will look a lot closer to a real C program than those for the 5.0 compiler.  The only downside is that these programs WILL NOT work with the 5.0 compiler.  So you better download the [OOPic] 6.0 compiler!.

    The first thing I always do with new hardware is to define any external device interfaces.  With the OOPic this means creating a list of the various I/O Line assignments.  The trick is to do this RIGHT AWAY and put the assignments right at the top of the program.  Once you do your assignments, write some tests programs to verify them.

    So, here are the I/O assignments for BOB.  Notice that I've adopted a consistent naming convention, and the assignments always appear at the top of my programs.  The naming convention is:  IO_ + FUNCTION_ + POSITION

    //-------------------------------------------------------
    // BOB I/O Port definitions
    //-------------------------------------------------------
    Const   IO_LINE_LEFT            = 3;    // Left Fairchild Analog Reflective sensor
    Const   IO_LINE_MID             = 2;    // Middle Fairchild Analog Reflective sensor
    Const   IO_LINE_RIGHT           = 1;    // Right Fairchild Analog Reflective sensor

    Const   IO_PROXIMITY_LEFT       = 8;    // Left Sharp Digital Prox sensor
    Const   IO_PROXIMITY_RIGHT      = 9;    // Right Sharp Digital Prox sensor
    Const   IO_PROXIMITY_REAR       = 10;   // Rear Sharp Digital Prox sensor

    Const   IO_LED1                 = 12;   // General Purpose LED 1
    Const   IO_LED2                 = 13;   // General Purpose LED 2
    Const   IO_LED3                 = 14;   // General Purpose LED 3
    Const   IO_LED4                 = 15;   // General Purpose LED 4
    Const   IO_LED_GROUP            = 1;    // LED I/O Group 1    (Lines 8-15)
    Const   IO_LED_NIBBLE           = 1;    // LED I/O High Nible (Lines 12-15)

    Const   IO_MOTOR_LEFT_FWD       = 24;   // Left Motor H-Bridge High
    Const   IO_MOTOR_LEFT_REV       = 25;   // Left Motor H-Bridge Low
    Const   IO_MOTOR_LEFT_PWM       = 18;   // Left Motor PWM control

    Const   IO_MOTOR_RIGHT_FWD      = 26;   // Right Motor H-Bridge High    
    Const   IO_MOTOR_RIGHT_REV      = 27;   // Right Motor H-Bridge Low 
    Const   IO_MOTOR_RIGHT_PWM      = 17;   // Right Motor PWM control

    Const   IO_ENCODER_LEFT_FRONT   = 31;   // Left A I/R optical interruptor
    Const   IO_ENCODER_LEFT_BACK    = 30;   // Left B I/R optical interruptor
    Const   IO_ENCODER_RIGHT_FRONT  = 29;   // Right A I/R optical interruptor
    Const   IO_ENCODER_RIGHT_BACK   = 28;   // Right B I/R optical interruptor

    Now that I have my I/O assignments, I can start writing some simple programs to test the various BOB functions.  Since I plan to save each of my test programs, I decided on a naming convention.  You'll see this convention on all my future programs:

    PBot_ + BotName + -Sequence_ + Compiler Version +  . osc

    So my first test program will be called:  PBot_BOB-A_VC6.osc

    Since each program will need it's own description, I've given them each their own page.  The list below summarizes each program and jumps off to their respective description. I've also included the source code for all of my programs on the [download page], just click on the program's file name if it's a hyper link.

    The Next Step

    Well, the obvious next step is to write some more programs.  I better get cracking :)

     

    Web content is copyright © PhilBot.com 2005, Deep Creek Lake, MD.
    Contact: Phil Malone 301.387.2331, webmaster@PhilBot.com