Using an Arduino to keep a Seiki 4K Display On

I love my Seiki 4k Display for writing code on my Mac. The one downside is that it times out and goes to sleep after 2 or 4 hours of inactivity (from the remote, not the screen). I decided to fix this problem in a somewhat complicated way: With an Arduino Uno that I already had, and an IR control kit.

I used the IR receiver to find the Seiki "Volume Up" and "Volume Down" codes, which appear to be structured like NEC codes. Those are hardcoded because I haven't really bothered to refine the setup or code any more. The IRBlaster library uses digital out 3 for the IR sends, and I used digital 8, 9, and 10 for red, yellow, and green indicators to give some indication of where in the refresh cycle things are. The code as-is sends the volume up and volume down signals every hour or so, and the indicators start with a slow blink on red, a slightly faster blink on yellow, and a fast blink before remote send on green.

IR Blaster set up (with IR receiver partially wired in still)
IR Blaster set up (with IR receiver partially wired in still)
#include <IRremote.h>
IRsend irsend;
int led = 13;
int red = 8;
int yellow = 9;
int green = 10;
void setup()
  pinMode(led, OUTPUT);
  pinMode(red, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(green, OUTPUT);
int choice(int i) {
  if(i > 1300) {
    return red;
  } else if (i > 900) {
    return yellow;
  return green;
void ledOn(int i) {
  digitalWrite(choice(i), HIGH);
void ledOff(int i) {
  digitalWrite(choice(i), LOW);
void loop() {
  while(true) {
    irsend.sendNEC(1086232679, 32); // seiki volume up
    irsend.sendNEC(1086206159, 32); // seiki volume down
    for(int i=1800; i >=0; i--) {