main.py 266 B

12345678910111213141516171819
  1. from LED import LED, cleanup
  2. from City import City
  3. from Controller import Controller
  4. import atexit
  5. LED_PORT = 12
  6. @atexit.register
  7. def exit():
  8. cleanup()
  9. beijing = City("北京")
  10. light = LED(LED_PORT)
  11. controller = Controller()
  12. controller.add(beijing, light)