local mon = peripheral.wrap("top")
os.loadAPI("button")

function work()
 if button.getState("track1Button") == true then
    --it is on!
    rs.setOutput("right",true)
 else
    --it is off
    rs.setOutput("right",false)
 end
end
mon.setTextScale(2)
w,h=mon.getSize()

button.setMon("top")

button.add("track1Button","Track 1","toggle",1,1,w,h,colors.green,colors.gray, colors.white,work)

button.setState("track1Button", false)

button.draw()

while true do
  button.check()
end
