Advertisement
nickey_CC

74HC161 Emulator for CC and EP

Sep 29th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. --constants
  2. input = "west"
  3. output = "east"
  4. pi = util.open("front")
  5. po = util.open("back")
  6. count = 0
  7. --Main
  8. while not rs.getInput("top") do
  9. sleep(0.1)
  10. if pi.testBundledInput(input,colors.gray) then
  11. --when clock
  12. print("clock")
  13. if not rs.getInput("right") then
  14. count = util.decode(pi.testBundledInput(input,colors.white),pi.testBundledInput(input,colors.orange),pi.testBundledInput(input,colors.magenta),pi.testBundledInput(input,colors.lightBlue))
  15. else
  16. if pi.testBundledInput(input,colors.pink) then
  17. count = (count + 1) % 16
  18. end
  19. end
  20. print(tostring(count))
  21. print(util.encodecol(count))
  22. end
  23. if not pi.testBundledInput(input,colors.lime) then
  24. count = 0
  25. end
  26. if not pi.testBundledInput(input,colors.yellow) then
  27. count = 15
  28. end
  29. po.setBundledOutput(output,util.encode(count))
  30. end
  31. po.setBundledOutput(output,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement