// Detect and show IR code received from an IR transmitter // Function ircode() returns 255 if no IR code is detected main() { int x; writes("ir Code", 500); loop { x = ircode(); // get IR code if(x < 255) writei('d', x, 200); // if(x == 9) break; // exit if key 9 is pressed } writes("end", 5000); }