'Bambino-03 SERTXD("B03",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 '----------------------------------------------------------------- Rationale: 'Test InfraRed input '------------------- 'receive IR code and send it to the PC; 'open the Terminal window [F8] to see the codes; ' set the baud to 4800; 'if you are not using the PicAxe controller TVR010 'then you will need to write down which keys give which codes; '================================================================= 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 inIRpin =c.6 'B0 parameter for SOUND 'B1 IRin value '================================================================= 'TVR010 PicAxe IR-controller '--------------------------- 'Before use, the transmitter must be programmed with the ‘Sony’ transmit code. '1. Insert 2 AAA size batteries, preferably alkaline. '2. Press ‘S’ and ‘B’ at the same time. S is in the centre of the arrows. ' The top left red LED should light. '3. Press ‘0’. The LED should flash. '4. Press ‘1’. The LED should flash. '5. Press ‘3’. The LED should go out. '6. Press the red power button (top right). '------------------------------------------- 'IRin cmnds using PicAxe controller 'DO NOT PRESS OTHER KEYS 'ie [A] [B] [C] [D] [E] [F] [G] 'They change the Mode and [B] has to be pressed to change back. '[square] [triangle] [()] [L] [X] [backwards F] have no effect SYMBOL KEY_POWER = 21 SYMBOL KEY_UP = 16 SYMBOL KEY_DOWN = 17 SYMBOL KEY_RIGHT = 18 SYMBOL KEY_LEFT = 19 SYMBOL KEY_BAR = 96 SYMBOL KEY_TENT = 54 SYMBOL KEY_VERT_CROSS = 37 SYMBOL KEY_VCROSS = 37 'synonym for easier coding SYMBOL KEY_DIAG_CROSS = 20 SYMBOL KEY_XCROSS = 20 'synonym for easier coding SYMBOL IRkey1 = 0 SYMBOL IRkey2 = 1 SYMBOL IRkey3 = 2 SYMBOL IRkey4 = 3 SYMBOL IRkey5 = 4 SYMBOL IRkey6 = 5 SYMBOL IRkey7 = 6 SYMBOL IRkey8 = 7 SYMBOL IRkey9 = 8 SYMBOL KEY_MINUS = 98 SYMBOL KEY_0 = 9 SYMBOL KEY_PLUS = 11 '================================================================= initialise: LOW eyeLedRpin_ 'make output and off LOW eyeLedLpin_ 'make output and off start: LET B0 = B0 + 1 'increment b0 SOUND VoiceLedpin_,(B0,2) 'make a sound TOGGLE eyeLedRpin_ 'alter eyeR TOGGLE eyeLedLpin_ 'alter eyeL IRIN [100,start],inIRpin,B1 'irin with timeout ' IRIN inIRpin,B1 'irin with no timeout SERTXD (#B1," ",CR) 'send value back to PC GOTO start 'loop back to start '=================================================================