Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long cur_time, old_time;
- int count = 0;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(115200);
- Serial1.begin(9600, SERIAL_8N1, 18, 19);
- }
- void loop() {
- cur_time = millis();
- if (cur_time - old_time >= 1000) {
- count++;
- Serial.println(count );
- tampil_text("t0", "Counter");
- tampil_text("t1", String(count));
- old_time = cur_time;
- }
- }
- void tampil_text(String _add_txt, String _txt_display) {
- String buf_txt = _add_txt + ".txt=" + "\"" + _txt_display + "\"";
- Serial1.print(buf_txt);
- Serial1.write(0xff);
- Serial1.write(0xff);
- Serial1.write(0xff);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement