' Program for www.robowars.org IBC controller for use with Smegway. ' ' Smegway, Malcolm's self-balancing ride-on robot. ' ' Copyright (C) 2007 Malcolm Faed ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or (at ' your option) any later version. ' ' This program is distributed in the hope that it will be useful, but ' WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ' General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ' USA ' $regfile = "attiny2313.dat" $crystal = 12000000 ' used crystal frequency 'left Ali1 Alias Portd.3 Bli1 Alias Portd.2 Dis1 Alias Portd.4 Lpwm Alias Pind.6 'left1 Ldisable Alias Pinb.7 'mix 'Ldir Alias Pind.5 'aux1 not used 'right Ali2 Alias Portd.1 Bli2 Alias Portd.0 Dis2 Alias Portb.1 Rpwm Alias Pinb.0 'right1 Rdisable Alias Pinb.6 'brake 'Rdir Alias Pinb.5 'deadband not used 'configure pin direction. Config Ali1 = Output Config Bli1 = Output Config Dis1 = Output Config Lpwm = Input Config Ldisable = Input 'Config Ldir = Input 'not used Config Ali2 = Output Config Bli2 = Output Config Dis2 = Output Config Rpwm = Input Config Rdisable = Input 'Config Rdir = Output 'not used 'misc Flip Alias Pinb.4 'flip not used Config Portb.2 = Output 'aux high Config Portb.3 = Output 'aux low Config Flip = Input 'not used Waitms 50 'wait for MCU to start 'Locked Antiphase Do Dis1 = Ldisable Dis2 = Rdisable Ali1 = Lpwm Bli1 = Not Lpwm Ali2 = Rpwm Bli2 = Not Rpwm Loop