var byte HALT_kamer_array[19] = {17,218,39,0,0,64,40,0,160,0,0,0,0,0,0,197,66,0,33}
var byte HEAT_kamer_array[19] = {17,218,39,0,0,65,40,0,160,0,0,0,0,0,0,197,2,0,226}
var byte*19 HALT_kamer_long at HALT_kamer_array --these variables are very long and
var byte*19 HEAT_kamer_long at HEAT_kamer_array --cover the existing arrays
var byte HALT_hal_array[19] = {17,218,39,0,0,64,40,0,160,0,0,0,0,0,0,197,66,0,33}
var byte HEAT_hal_array[19] = {17,218,39,0,0,65,40,0,160,0,0,0,0,0,0,197,2,0,226}
var byte*19 HALT_kamer_long at HALT_hal_array
var byte*19 HEAT_kamer_long at HEAT_hal_array
var byte*19 send_buffer_long
var bit send_buffer_next_bit at send_buffer_long:0
-- choose what to send
send_buffer_long=HEAT_hal_long -- all the variable is copied to the output buffer
-- now send all the bits
LED=on
_usec_delay(10000) -- send a long burst to calibrate the receiver
LED=off
_usec_delay(2000)
for (8*19) loop
LED=on
_usec_delay(450) -- send a burst
LED=off
if send_buffer_next_bit == 1 then -- wait additional time if sending a "1"
_usec_delay(840) -- the difference between 1190 and 350
end if
_usec_delay(350) --you can reduce this a bit to compensate for the
--time needed for the shifting
send_buffer_long=send_buffer_long >> 1 --takes a while to shift such a long
--variable, but it always takes the
--same amount of time
end loop
LED=on
_usec_delay(450) -- send a final burst to end the last bit
LED=off