项目作者: limingjie

项目描述 :
M5Stack Traffic Light
高级语言: C++
项目地址: git://github.com/limingjie/M5Stack_Traffic_Light.git
创建时间: 2019-04-10T11:46:03Z
项目社区:https://github.com/limingjie/M5Stack_Traffic_Light

开源协议:The Unlicense

下载


M5Stack Traffic Light

A traffic light toy build by M5Stack.

M5Stack Traffic Light Video

Build

  • Setup Arduino development environment follow M5Stack Docs - Arduino IDE Development.
  • Install Adafruit NeoPixel library, supports up to 1.2.5, it does not work with 1.3.0 or above. There was a bug of the m5stack’s light strip control, I will try the latest version of m5stack library when I have time.

Customize The Traffic Light

Find the traffic light sequence definition in TrafficLight.ino. Customize the sequence in lights array.

  1. // Traffic light struct
  2. typedef struct
  3. {
  4. int color_index; // 1 - Red, 2 - Yellow, 3 - Green
  5. bool turn_left;
  6. bool blink;
  7. unsigned long interval; // milliseconds
  8. } Traffic_Light;
  9. // Traffic light sequences
  10. Traffic_Light lights[] = {
  11. {3, false, false, 30999},
  12. {3, true, true, 30999},
  13. {2, true, true, 10999},
  14. {1, false, false, 30999},
  15. {1, false, true, 10999}};