'Bambino-08 SERTXD("B08",CR) 'report program number @4800baud #PicAxe 20M2 #no_data 'Bambino-01 Test eyeLEDs, whiskerLEDs and speaker 'Bambino-02 Test PWM of eyeLEDs 'Bambino-03 Test InfraRed input 'Bambino-04 Test Eye light values 'Bambino-05 Test Whisker light values 'Bambino-06 Play the inbuilt tunes using keys 1 to 4 and beep on 5 'Bambino-07 Set servos to mid position 'Bambino-08 Calibrate servo mid positions and put in EEPROM. '----------------------------------------------------------------- Rationale: 'Calibrate servo mid positions. '----------------------------- 'The pulsout value must be between 100 and 200 ' otherwise the servo may be damaged. 'Because of the way each servo is made and ' the horns can only be put on about every 15 degrees ' the feet may not be exactly side by side or flat on the ground. 'Edit the servo mid positions, rollC and paceC, and ' reload the program until the feet are in the right position. 'The calibrated values are stored in EEPROM for further programs. 'If you want you can program Bambino with Bambino-08+.bas and use the ' infra-red-controller to adjust and store the rollC and paceC positions. ' and then carry on with Bambino-10. However you should read this program ' so you understand what is being done. '================================================================= SYMBOL servopacepin =c.0 'left connector SYMBOL servorollpin =c.4 'right connector SYMBOL VoiceLedpin_ =c.5 SYMBOL eyeLedLpin_ =c.2 'low =>LED on SYMBOL eyeLedRpin_ =b.1 'low =>LED on SYMBOL GwhiskerLedLpin_ =c.3 'low =>Ground whisker LED on SYMBOL GwhiskerLedRpin_ =b.3 'low =>Ground whisker LED on SYMBOL eyeRpin =c.7 SYMBOL eyeLpin =c.1 SYMBOL IRinpin =c.6 SYMBOL IRoutpin =b.2 'EEPROM DATA SYMBOL DrollC =254 SYMBOL DpaceC =255 SYMBOL rollC =155 '100 is roll to the left, 150 is nominal centre SYMBOL paceC =150 '100 is left foot back, 150 is nominal centre initialise: WRITE DrollC,rollC 'save for other programs WRITE DpaceC,paceC 'save for other programs LOW eyeLedRpin_ 'make output HIGH eyeLedLpin_ 'make output start: TOGGLE eyeLedRpin_ 'flash eyeR so we know program is running TOGGLE eyeLedLpin_ 'flash eyeR so we know program is running PULSOUT servopacepin,paceC 'pulse servo paceC PULSOUT servorollpin,rollC 'pulse servo rollC PAUSE 20 'pause 20ms GOTO start 'loop back to start '=================================================================