Symbol IR = b13 'b13 is an INTERNALLY specified variable location 'where the infrared command number is stored 'after it is decoded by the Picaxe ;111111111111111111111111111111111111111111111111111111111111111111111111 ;1 1 ;1 SIMPLE 3 CHANNEL SONY INFRARED REMOTE CONTROL 1 ;1 1 ;111111111111111111111111111111111111111111111111111111111111111111111111 ;Infrared remote controller... ; SONY IR TV remote controller turns on and off 3 devices ; attached to relays on logical pins 0,1 and 4 ; This program looks for remote control codes 0-7. ; Remote control code Action ; 0 all relays off ; 1 OPTO1 on ; 2 OPTO2 on ; 3 OPTOS 1 & 2 on ; 4 Relay on ; 5 Relay & OPTO1 on ; 6 Relay & OPTO2 on ; 7 Relay & OPTOS 1 & 2 on ; ; Low pin# pulls that output pin low providing a current sink for the OPTOs ; or Relay attached to it; thereby turning that item on. ; High pin# allows that output pin to float back high via the internal ; pullup resistor; thereby turning off tha item attached to the pin. CMD: Infrain2 'get an IR remote control press If IR>0 then IRON ;turn something on (CODE numbers 1-7)? DOFF: High 0 ;all items off (CODE number 0) High 1 High 4 Goto CMD ;go get another command IRON: If IR<4 then IR40 ;which item? Code>3 then item 3 Low 4 ;turn on item 3 IR = IR - 4 ;adjust out item 3 Goto IR2 IR40: High 4 ;turn off item 3 IR2: If IR<2 then IR20 ;check remainder of control variable for item 2? Low 1 IR = IR - 2 ;adjust out item 2 Goto IR1 IR20: High 1 ;turn off item 2 IR1: If IR<1 then IR10 ;check remainder of control variable for item 1? Low 0 Goto CMD IR10: High 0 ;turn off item 1 Goto CMD ;go get the next command