__init__.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. """
  2. Here is a simple example for controlling a Betabrite Prism via USB::
  3. import time
  4. import alphasign
  5. def main():
  6. sign = alphasign.USB(alphasign.devices.USB_BETABRITE_PRISM)
  7. sign.connect()
  8. sign.clear_memory()
  9. # create logical objects to work with
  10. counter_str = alphasign.String(size=14, label="1")
  11. counter_txt = alphasign.Text("counter value: %s%s" % (alphasign.colors.RED,
  12. counter_str.call()),
  13. label="A",
  14. mode=alphasign.modes.HOLD)
  15. # allocate memory for these objects on the sign
  16. sign.allocate((counter_str, counter_txt))
  17. # tell sign to only display the counter text
  18. sign.set_run_sequence((counter_txt,))
  19. # write objects
  20. for obj in (counter_str, counter_txt):
  21. self.write(obj)
  22. # (strictly) monotonically increasing counter
  23. counter_value = 0
  24. while True:
  25. counter_str.data = counter_value
  26. sign.write(counter_str)
  27. counter_value += 1
  28. time.sleep(1)
  29. if __name__ == "__main__":
  30. main()
  31. """
  32. import datetime
  33. import os
  34. import sys
  35. import serial
  36. import constants
  37. from interfaces.local import DebugInterface
  38. from interfaces.local import Serial
  39. from interfaces.local import USB
  40. from time import Time
  41. from date import Date
  42. from string import String
  43. from packet import Packet
  44. from text import Text
  45. import charsets
  46. import colors
  47. import counters
  48. import devices
  49. import extchars
  50. import modes
  51. import positions
  52. import speeds