Arduino no upload this code say error: 'displayClock' was not declared in this scope. This is declared? what is wrong?
#include <DHT.h>
#include <DHT_U.h>
#include <FastLED.h>
#include <Wire.h>
#include "RTClib.h"
#include <SoftwareSerial.h>
#include "Timer.h"
#define DHTPIN 12
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#define NUM_LEDS 168
#define DATA_PIN 2
CRGB LEDs[NUM_LEDS];
SoftwareSerial BTserial(8, 9);
RTC_DS3231 rtc;
Timer t1;
Timer t2;
Timer t3;
String btBuffer;
CRGB colorCRGB = CRGB::Red; // Change this if you want another default color, for example CRGB::Blue
CHSV colorCHSV = CHSV(95, 255, 255); // Green
CRGB colorOFF = CRGB(20,20,20); // Color of the segments that are 'disabled'. You can also set it to CRGB::Black
volatile int colorMODE = 1; // 0=CRGB, 1=CHSV, 2=Constant Color Changing pattern
volatile int mode = 0; // 0=Clock, 1=Temperature, 2=Humidity, 3=Scoreboard, 4=Time counter
volatile int scoreLeft = 0;
volatile int scoreRight = 0;
volatile long timerValue = 0;
volatile int timerRunning = 0;
#define blinkDots 0 // Set this to 1 if you want the dots to blink in clock mode, set it to value 0 to disable
#define hourFormat 24 // Set this to 12 or to 24 hour format
#define temperatureMode 'C' // Set this to 'C' for Celcius or 'F' for Fahrenheit
void setup () {
// Initialize LED strip
FastLED.delay(3000);
// Check if you're LED strip is a RGB or GRB version (third parameter)
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(LEDs, NUM_LEDS);
Serial.begin(9600);
while (!Serial) { /* Wait until serial is ready */ }
BTserial.begin(9600);
Serial.println("BTserial started at 9600");
dht.begin();
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
if (rtc.lostPower()) {
Serial.println("RTC lost power, lets set the time!");
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
t1.every(1000 * 29, refreshDisplay);
t2.every(1000, refreshTimer);
t3.every(50, updateHue);
refreshDisplay();
}
void loop () {
t1.update();
t2.update();
t3.update();
if (BTserial.available())
{
char received = BTserial.read();
btBuffer += received;
if (received == '|')
{
processCommand();
btBuffer = "";
}
}
}
void updateHue() {
if (colorMODE != 2)
return;
colorCHSV.sat = 255;
colorCHSV.val = 255;
if (colorCHSV.hue >= 255){
colorCHSV.hue = 0;
} else {
colorCHSV.hue++;
}
refreshDisplay();
}
void refreshDisplay() {
switch (mode) {
case 0:
displayClock();
break;
case 1:
displayTemperature();
break;
case 2:
displayHumidity();
break;
case 3:
displayScoreboard();
break;
case 4:
// Time counter has it's own timer
break;
default:
break;
}
}
void refreshTimer() {
if (mode == 0 && blinkDots == 1) {
displayDots(3);
} else if (mode == 4 && timerRunning == 1 && timerValue < 6000) {
timerValue++;
int m1 = (timerValue / 60) / 10 ;
int m2 = (timerValue / 60) % 10 ;
int s1 = (timerValue % 60) / 10;
int s2 = (timerValue % 60) % 10;
displaySegments(0, s2);
displaySegments(7, s1);
displaySegments(16, m2);
displaySegments(23, m1);
displayDots(0);
FastLED.show();
}
}