/*
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// # # # # # ###### ####### ####### # #######
// ## ## # # ## # # # # # # # # #
// # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # #####
// # # ####### # # # # # # # # ####### #
// # # # # # ## # # # # # # # #
// # # # # # # ###### ####### ####### # # #
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <EEPROM.h>
#include <LiquidCrystal_I2C.h>
// Inisialisasi objek LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); // Alamat I2C umumnya adalah 0x27
/* **********************************************************************
Shift Register 74HC595 with 32 LEDs
Circuit:
____________________ ____________________ ____________________
LED D12 D11 | LED | D11 | LED | D11 | LED | D11
5V 0 MISO GND MOSI D10 5V | 5V 8 | GND MOSI D10 5V | 5V 16 | GND MOSI D10 5V | 5V 24 | GND MOSI D10 5V
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--|
| VCC Q0 DS OE ST_CP SH_CP MR Q7' | | VCC Q0 DS OE ST_CP SH_CP MR Q7' | | VCC Q0 DS OE ST_CP SH_CP MR Q7' | | VCC Q0 DS OE ST_CP SH_CP MR Q7' |
| | | | | | | |
| Q1 Q2 Q3 Q4 Q5 Q6 Q7 GND | | Q1 Q2 Q3 Q4 Q5 Q6 Q7 GND | | Q1 Q2 Q3 Q4 Q5 Q6 Q7 GND | | Q1 Q2 Q3 Q4 Q5 Q6 Q7 GND |
|--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--| |--|----|----|----|----|----|----|----|--|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
LED LED LED LED LED LED LED GND LED LED LED LED LED LED LED GND LED LED LED LED LED LED LED GND LED LED LED LED LED LED LED GND
1 2 3 4 5 6 7 9 10 11 12 13 14 15 17 18 19 20 21 22 23 25 26 27 28 29 30 31
********************************************************************* */
#define DATA_PIN 12 // Pin connected to DS of 74HC595
#define LATCH_PIN 11 // Pin connected to STCP of 74HC595
#define CLOCK_PIN 10 // Pin connected to SHCP of 74HC595
// Mode EPROM
byte save_channel = 0;
byte save_mode = 1;
#define pot_speed A0
#define button_switch A1
// How many of the shift registers
#define NUM_SHIFT_REGS 4
const uint8_t numOfRegisterPins = NUM_SHIFT_REGS * 8;
bool registers[numOfRegisterPins];
uint8_t jumlah_lampu;
int led = 0;
int led_lcd = 0;
bool stats_lcd = 0;
bool stats_set_led = 0;
uint8_t num = 1;
uint8_t id_num = 0;
uint8_t id_num_loop = 0;
int id_anim;
bool text = 0;
unsigned long waktuLed;
unsigned long jedaLed = 0;
unsigned long jedaLcd = 0;
// Variables will change:
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
byte btn_counter = 0;
byte counter = 0;
unsigned long lastDebounceTime = 0;
unsigned long debounceDelay = 50;
byte kosong[] = {
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
};
byte loading[] = {
0x00,
0x0E,
0x0E,
0x0E,
0x0E,
0x0E,
0x0E,
0x00
};
byte senyum[] = {
0x00,
0x0A,
0x0A,
0x00,
0x00,
0x11,
0x0E,
0x00
};
void setup() {
Serial.begin(9600);
Serial.println("MZF_75HC959__Ver.2.5");
Serial.println("LCD 16x2, EEPROM");
Serial.println("by MANDOZAF");
printUsage();
jumlah_lampu = EEPROM.read(save_channel);
id_anim = EEPROM.read(save_mode);
// Inisialisasi LCD
lcd.init();
lcd.backlight(); // Aktifkan backlight LCD
lcd.createChar(0, kosong);
lcd.createChar(1, loading);
lcd.createChar(2, senyum);
loading_dulu();
lcd.clear();
if (jumlah_lampu > 32) {
jumlah_lampu = 32;
}
pinMode(DATA_PIN, OUTPUT);
pinMode(CLOCK_PIN, OUTPUT);
pinMode(LATCH_PIN, OUTPUT);
pinMode(button_switch, INPUT);
pinMode(pot_speed, INPUT);
clearRegisters();
writeRegisters();
}
void loop() {
// Serial.println(led);
int reading = digitalRead(button_switch);
if (reading == 1 && analogRead(pot_speed) > 1000 && id_anim > 10) {
btn_counter++;
if (btn_counter > 100) {
btn_counter = 0;
if (counter > 1) {
counter = 0;
stats_set_led = 1;
} else {
counter++;
}
}
// Serial.println(counter);
}
if (stats_set_led == 0) {
waktuLed = map(analogRead(pot_speed), 0, 1023, 1, 20) * 50;
if (waktuLed < 1000 && waktuLed >= 100) {
lcd.setCursor(12, 1);
lcd.print(" ");
lcd.setCursor(13, 1);
lcd.print(waktuLed);
} else if (waktuLed < 100) {
lcd.setCursor(12, 1);
lcd.print(" ");
lcd.setCursor(14, 1);
lcd.print(waktuLed);
} else {
lcd.setCursor(12, 1);
lcd.print(waktuLed);
}
if (reading != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
if (reading != buttonState) {
buttonState = reading;
if (buttonState == HIGH) {
text = 0;
led = 0;
led_lcd = 0;
num = 1;
set_all(0);
for (uint8_t i = 0; i < 12; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
id_anim++;
EEPROM.update(save_mode, id_anim);
}
}
}
lastButtonState = reading;
if (id_anim > 16) {
id_anim = 1;
EEPROM.update(save_mode, id_anim);
}
lcd.setCursor(11, 0);
lcd.print(" ");
if (jumlah_lampu > 9) {
lcd.setCursor(12, 0);
lcd.print(jumlah_lampu);
} else {
lcd.setCursor(12, 0);
lcd.print(" ");
lcd.setCursor(13, 0);
lcd.print(jumlah_lampu);
}
lcd.setCursor(14, 0);
lcd.print("ch");
if (text == 0) {
Serial.print("Mode Animasi : "); Serial.println(id_anim);
text = 1;
}
lcd.setCursor(0, 1);
lcd.print("mode:");
if (id_anim > 9) {
lcd.setCursor(5, 1);
lcd.print(id_anim);
} else {
lcd.setCursor(6, 1);
lcd.print(" ");
lcd.setCursor(5, 1);
lcd.print(id_anim);
}
lcd.setCursor(8, 1);
lcd.print("dly:");
animasi(id_anim);
} else {
if ( millis() - jedaLed >= 200) {
jedaLed = millis();
stats_lcd = !stats_lcd;
}
if (reading == 1 && stats_set_led == 1 && analogRead(pot_speed) > 300 && analogRead(pot_speed) < 700) {
btn_counter++;
if (stats_lcd == 0) {
lcd.noDisplay();
} else {
lcd.display();
}
if (btn_counter > 100) {
counter++;
if (counter > 1) {
for (uint8_t i = 0; i <= 32; i++) {
setRegisterPin(i, 0);
writeRegisters();
}
led = 0;
num = 1;
counter = 0;
stats_set_led = 0;
lcd.display();
EEPROM.update(save_channel, jumlah_lampu);
Serial.print("update:"); Serial.print(jumlah_lampu); Serial.println(" ch");
// resetFunc();
}
}
// Serial.println(btn_counter);
} else {
btn_counter = 0;
counter = 0;
}
if (reading != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
if (reading != buttonState) {
buttonState = reading;
if (buttonState == HIGH) {
if (analogRead(pot_speed) > 700 && analogRead(pot_speed) < 1023) {
jumlah_lampu++;
for (uint8_t i = 0; i <= 32; i++) {
setRegisterPin(i, 0);
writeRegisters();
}
} else if (analogRead(pot_speed) > 0 && analogRead(pot_speed) < 300) {
jumlah_lampu--;
for (uint8_t i = 0; i <= 32; i++) {
setRegisterPin(i, 0);
writeRegisters();
}
}
if (jumlah_lampu > 32) {
jumlah_lampu = 1;
} else if (jumlah_lampu < 1) {
jumlah_lampu = 32;
}
}
}
}
if (stats_lcd == 0) {
setRegisterPin(jumlah_lampu - 1, 0);
writeRegisters();
} else {
setRegisterPin(jumlah_lampu - 1, 1);
writeRegisters();
}
lastButtonState = reading;
lcd.setCursor(0, 0);
lcd.print("SET JUMLAH LAMPU");
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(2, 1);
lcd.print("LAMPU = ");
if (jumlah_lampu > 9) {
lcd.setCursor(10, 1);
lcd.print(jumlah_lampu);
lcd.setCursor(12, 1);
lcd.print("ch");
} else {
lcd.setCursor(10, 1);
lcd.print(" ");
lcd.setCursor(11, 1);
lcd.print(jumlah_lampu);
lcd.setCursor(12, 1);
lcd.print("ch");
}
lcd.setCursor(14, 1);
lcd.print(" ");
}
// animasi_run_chase(1, 0);
}
void animasi(int x) {
switch (x) {
case 1:
animasi_run_dot(0, 1);
break;
case 2:
animasi_run_dot(1, 1);
break;
case 3:
animasi_run_dot(0, 0);
break;
case 4:
animasi_run_dot(1, 0);
break;
case 5:
animasi_run_fill(0, 1);
break;
case 6:
animasi_run_fill(1, 1);
break;
case 7:
animasi_run_fill(0, 0);
break;
case 8:
animasi_run_fill(1, 0);
break;
case 9:
animasi_run_chase(0, 1);
break;
case 10:
animasi_run_chase(1, 1);
break;
case 11:
animasi_run_chase(0, 0);
break;
case 12:
animasi_run_chase(1, 0);
break;
case 13:
animasi_run_halfchase(0, 1);
break;
case 14:
animasi_run_halfchase(1, 1);
break;
case 15:
animasi_run_halfchase(0, 0);
break;
case 16:
animasi_run_halfchase(1, 0);
break;
default:
animasi_run_dot(0, 1);
break;
}
}
void animasi_run_dot(bool rev, bool strobe) {
switch (num) {
case 1:
if (rev == 0) {
setRegisterPin(led, 1);
setRegisterPin(led - 1, 0);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(1));
lcd.setCursor((led_lcd - 1) % 10, 0);
lcd.write(byte(0));
} else {
setRegisterPin((jumlah_lampu - 1) - led, 1);
setRegisterPin((jumlah_lampu - 1) - led + 1, 0);
writeRegisters();
lcd.setCursor((10 - 1) - led_lcd % 10, 0);
lcd.write(byte(1));
lcd.setCursor((10 - 1) - led_lcd + 1 % 9, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
clearRegisters();
led = 0;
if (strobe == 0) {
num = 1;
} else {
num = 2;
}
break;
case 2:
set_all(0);
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 3;
}
break;
case 3:
set_all(1); // hidup semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
num = 4;
}
break;
case 4:
set_all(0); // mati semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
id_num_loop++;
if (id_num_loop > 1) {
num = 5;
id_num_loop = 0;
} else {
num = 3;
}
}
break;
case 5:
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 1;
}
break;
}
}
}
void animasi_run_fill(bool rev, bool strobe) {
switch (num) {
case 1:
if (rev == 0) {
setRegisterPin(led, 1);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(1));
} else {
setRegisterPin((jumlah_lampu - 1) - led, 1);
writeRegisters();
lcd.setCursor(9 - led_lcd % 10, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
led = 0;
if (strobe == 0) {
num = 6;
} else {
num = 2;
}
}
break;
case 2:
set_all(0);
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 3;
}
break;
case 3:
set_all(1); // hidup semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
num = 4;
}
break;
case 4:
set_all(0); // mati semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
id_num_loop++;
if (id_num_loop > 1) {
num = 5;
id_num_loop = 0;
} else {
num = 3;
}
}
break;
case 5:
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 1;
}
break;
case 6:
if (rev == 0) {
setRegisterPin((jumlah_lampu - 1) - led, 0);
writeRegisters();
lcd.setCursor(9 - led_lcd % 10, 0);
lcd.write(byte(1));
} else {
setRegisterPin(led, 0);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
set_all(0);
led = 0;
if (strobe == 0) {
num = 5;
} else {
num = 2;
}
}
break;
}
}
void animasi_run_chase(bool rev, bool strobe) {
switch (num) {
case 1:
if (rev == 0) {
setRegisterPin(led, 1);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(1));
} else {
setRegisterPin((jumlah_lampu - 1) - led, 1);
writeRegisters();
lcd.setCursor(9 - led_lcd % 10, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
led = 0;
if (strobe == 0) {
num = 6;
} else {
num = 2;
}
}
break;
case 2:
if (rev == 0) {
setRegisterPin(led, 0);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(0));
} else {
setRegisterPin((jumlah_lampu - 1) - led, 0);
writeRegisters();
lcd.setCursor(9 - led_lcd % 10, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
led = 0;
num = 3;
}
break;
case 3:
set_all(1); // hidup semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
num = 4;
}
break;
case 4:
set_all(0); // mati semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
id_num_loop++;
if (id_num_loop > 1) {
num = 5;
id_num_loop = 0;
} else {
num = 3;
}
}
break;
case 5:
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 1;
}
break;
case 6:
if (rev == 0) {
setRegisterPin(led, 0);
writeRegisters();
lcd.setCursor(led_lcd % 10, 0);
lcd.write(byte(0));
} else {
setRegisterPin((jumlah_lampu - 1) - led, 0);
writeRegisters();
lcd.setCursor(9 - led_lcd % 10, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 10) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu) {
set_all(0);
led = 0;
if (strobe == 0) {
num = 1;
} else {
num = 2;
}
}
break;
}
}
void animasi_run_halfchase(bool rev, bool strobe) {
switch (num) {
case 1:
if (rev == 0) {
setRegisterPin(led, 1);
setRegisterPin((jumlah_lampu - 1) - led, 1);
lcd.setCursor(led_lcd % 5, 0);
lcd.write(byte(1));
lcd.setCursor(9 - led_lcd % 5, 0);
lcd.write(byte(1));
writeRegisters();
} else {
setRegisterPin((jumlah_lampu / 2) - led - 1, 1);
setRegisterPin((jumlah_lampu / 2) + led, 1);
lcd.setCursor(5 + led_lcd % 5, 0);
lcd.write(byte(1));
lcd.setCursor(4 - led_lcd % 5, 0);
lcd.write(byte(1));
writeRegisters();
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 5) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu / 2) {
led = 0;
if (strobe == 0) {
num = 6;
} else {
num = 2;
}
}
break;
case 2:
set_all(0);
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 3;
}
break;
case 3:
set_all(1); // hidup semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
num = 4;
}
break;
case 4:
set_all(0); // mati semua
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
id_num++;
}
if (id_num >= 2) {
id_num = 0;
id_num_loop++;
if (id_num_loop > 1) {
num = 5;
id_num_loop = 0;
} else {
num = 3;
}
}
break;
case 5:
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
num = 1;
}
break;
case 6:
if (rev == 0) {
setRegisterPin(led, 0);
setRegisterPin((jumlah_lampu - 1) - led, 0);
lcd.setCursor(led_lcd % 5, 0);
lcd.write(byte(0));
lcd.setCursor(9 - led_lcd % 5, 0);
lcd.write(byte(0));
writeRegisters();
} else {
setRegisterPin((jumlah_lampu / 2) - led - 1, 0);
setRegisterPin((jumlah_lampu / 2) + led, 0);
lcd.setCursor(5 + led_lcd % 5, 0);
lcd.write(byte(0));
lcd.setCursor(4 - led_lcd % 5, 0);
lcd.write(byte(0));
writeRegisters();
}
if ( millis() - jedaLed >= waktuLed) {
jedaLed = millis();
led++;
if (led_lcd >= 5) {
led_lcd = 0;
for (uint8_t i = 0; i < 10; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(1));
}
} else {
led_lcd++;
}
}
if (led >= jumlah_lampu / 2) {
set_all(0);
led = 0;
if (strobe == 0) {
num = 1;
} else {
num = 2;
}
}
break;
}
}
void set_all(bool x) {
for (uint8_t i = 0; i < jumlah_lampu; i++) {
setRegisterPin(i, x);
writeRegisters();
}
}
void clearRegisters() {
// Reset all register pins
for (int i = numOfRegisterPins - 1; i >= 0; i--) {
registers[i] = LOW;
}
}
void setRegisterPin(int index, int value) {
// Set an individual pin HIGH or LOW
registers[index] = value;
}
void writeRegisters() {
// Set and display registers
digitalWrite(LATCH_PIN, LOW);
for (int i = numOfRegisterPins - 1; i >= 0; i--) {
digitalWrite(CLOCK_PIN, LOW);
digitalWrite(DATA_PIN, registers[i]);
digitalWrite(CLOCK_PIN, HIGH);
}
digitalWrite(LATCH_PIN, HIGH);
}
void loading_dulu() {
lcd.setCursor(0, 0);
lcd.print("LOADING BOS");
lcd.setCursor(15, 0);
lcd.write(byte(2));
for (uint8_t i = 0; i < 16; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(1));
delay(50);
}
for (uint8_t i = 0; i < 16; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(0));
delay(50);
}
for (uint8_t i = 0; i < 16; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(1));
delay(50);
}
for (uint8_t i = 0; i < 16; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(0));
delay(50);
}
for (uint8_t i = 0; i < 16; i++) {
lcd.setCursor(i, 0);
lcd.write(byte(0));
delay(50);
}
}
const char usageText[] PROGMEM = R"=====(
Cara Menggunakan:
untuk masuk ke set jumlah channel:
1. putar potentio mentok ke kanan
2. buat mode diatas mode 10 (karena dibawah mode 10 tidak berpengaruh)
3. tekan lama tombol sampai muncul layar set channel
untuk menset jumlah channel:
1. putar potentio ke kiri dan tekan tombol untuk mengurangi channel
2. putar potentio ke kanan dan tekan tombol untuk menambah channel
3. putar potentio ke tengah dan tekan lama tombol sampai muncul layar mode
)=====";
void printUsage() {
Serial.println((const __FlashStringHelper *)usageText);
}
void(* resetFunc) (void) = 0;