Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("top")
- side_m = "left"
- pionColor = "red"
- m.clear()
- function fillTable()
- button.setTable("*1*", col1, 5,9,2,4)
- button.setTable("*2*", col2, 11,15,2,4)
- button.setTable("*3*", col3, 17,21,2,4)
- button.setTable("*4*", col4, 23,27,2,4)
- button.setTable("*5*", col5, 29,33,2,4)
- button.setTable("*6*", col6, 35,39,2,4)
- button.setTable("*7*", col7, 41,45,2,4)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function col1()
- button.flash("*1*")
- peripheral.call(side_m,"transmit",2,0, pionColor)
- print("col1")
- end
- function col2()
- button.flash("*2*")
- peripheral.call(side_m,"transmit",3,0, pionColor)
- print("col2")
- end
- function col3()
- button.flash("*3*")
- peripheral.call(side_m,"transmit",4,0, pionColor)
- print("col3")
- end
- function col4()
- button.flash("*4*")
- peripheral.call(side_m,"transmit",5,0, pionColor)
- print("col4")
- end
- function col5()
- button.flash("*5*")
- peripheral.call(side_m,"transmit",6,0, pionColor)
- print("col5")
- end
- function col6()
- button.flash("*6*")
- peripheral.call(side_m,"transmit",7,0, pionColor)
- print("col6")
- end
- function col7()
- button.flash("*7*")
- peripheral.call(side_m,"transmit",8,0, pionColor)
- print("col7")
- end
- fillTable()
- --button.heading("Demo Button Prog")
- --button.label(1,5,"Demo!")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment