From 77b28b27c3df2208f0cca8bd1ffac79ae3cd3264 Mon Sep 17 00:00:00 2001 From: Yves Ehrlich Date: Sun, 2 Feb 2020 19:43:19 +0100 Subject: [PATCH] LCD refresh alle 100ms --- Code/miniRobotRC/interruptRoutinen.ino | 6 +++++- Code/miniRobotRC/miniRobotRC.ino | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Code/miniRobotRC/interruptRoutinen.ino b/Code/miniRobotRC/interruptRoutinen.ino index 763929b..cce5cf5 100644 --- a/Code/miniRobotRC/interruptRoutinen.ino +++ b/Code/miniRobotRC/interruptRoutinen.ino @@ -1,6 +1,10 @@ //HIER KOMMT ALLES REIN WAS 1 MAL PRO ms AUFGERUFEN WERDEN SOLL!!! ISR(TIMER2_COMPA_vect) { tasten.checkButtons(); - lcd.renderAll(); + renderTime++; + if(renderTime >= renderTimeout) { + lcd.renderAll(); + renderTime = 0; + } } //ALLE anderen ISR kommen HIER drunter!!! diff --git a/Code/miniRobotRC/miniRobotRC.ino b/Code/miniRobotRC/miniRobotRC.ino index 83d1c0e..79c3ee7 100644 --- a/Code/miniRobotRC/miniRobotRC.ino +++ b/Code/miniRobotRC/miniRobotRC.ino @@ -15,6 +15,9 @@ volatile PCD8544_SPI_FB lcd; volatile myInterrupts Timer2; volatile myInterrupts pwmBL; volatile shiftRegButton tasten; +//LCD +uint8_t renderTime = 0; +#define renderTimeout 100 //Kommandos #define nothing 9 //reset/nichts tun