main.lua 705 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. DEBUG = true
  2. function debug_message(message)
  3. if DEBUG then
  4. print(message)
  5. end
  6. --TODO: rolling last 10
  7. end
  8. local yo = require('yo')
  9. local server = require('server')
  10. local statusMessages = {
  11. [0] = 'not enabled',
  12. 'connecting',
  13. 'wrong password',
  14. 'network not found',
  15. 'connection fail',
  16. 'connected'
  17. }
  18. a = '0c6ac771-71fa-420f-810c-2853989a8ca6'
  19. y = 'ariyeah'
  20. wifi.sta.config('Pizza Pirate Cove', 'pizzapirates')
  21. wifi.setmode(wifi.STATION)
  22. function short_press()
  23. server.stop()
  24. yo.yo(y, a)
  25. end
  26. function long_press()
  27. current_settings = {
  28. yo_recipient = y,
  29. ssid = wifi.sta.getconfig(),
  30. status = statusMessages[wifi.sta.status()]
  31. }
  32. server.start(current_settings)
  33. end