Created
December 13, 2020 05:37
-
-
Save maxpromer/de6a152d9f62390f4efd595335eaa7ac to your computer and use it in GitHub Desktop.
IOXhop_DotMatrix demo code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IOXhop_DotMatrix.h> | |
#define MAX_DEVICES 8 // จำนวนโมดูล Dot Matrix (จำนวนไอซี MAX7219) | |
#define DIN_PIN 23 // กำหนดขา DIN | |
#define CLK_PIN 18 // กำหนดขา CLK | |
#define CS_PIN 5 // กำหนดขา CS | |
IOXhop_DotMatrix dot(MAX_DEVICES, CS_PIN, DIN_PIN, CLK_PIN); | |
void setup() { | |
dot.begin(); | |
} | |
void loop() { | |
dot.scrollInBottom("IOXhop.com", 50); // เลื่อนข้อความ IOXhop.com ขึ้นมาจากด้านล่าง | |
delay(300); | |
dot.invertColor(); // สลับสีบนจอ | |
delay(300); | |
dot.invertColor(); // สลับสีบนจอ | |
delay(300); | |
dot.invertColor(); // สลับสีบนจอ | |
delay(300); | |
dot.scrollOutLeft("IOXhop.com", 50); // เลื่อนข้อความ IOXhop.com ออกทางด้านซ้าย | |
dot.scrollInTop("Electronic", 50); // เลื่อนข้อความ Electronic ขึ้นมาจากด้านบน | |
delay(1000); | |
dot.showTextCenter("Component"); // แสดงข้อความ Component กลางจอ | |
delay(1000); | |
dot.showTextCenter("ESP32"); // แสดงข้อความ ESP32 กลางจอ | |
delay(1000); | |
dot.showTextCenter("Arduino"); // แสดงข้อความ Arduino กลางจอ | |
delay(1000); | |
dot.scrollInRight("K210 STM32", 50); // เลื่อนข้อความ K210 STM32 เข้าทางด้านขวา | |
delay(2000); | |
dot.scrollOutBottom("K210 STM32", 50); // เลื่อนข้อความ K210 STM32 ออกทางด้านล่าง | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment