tenia un código arduino para el display tm1638 y funcionaba de lujo , pero no se el motivo ahora me da error , que antes no daba, ya que lo tengo guardado de siempre así y funcionaba perfectamente,
como he formateado va todo bien pero al cargar el sketch me da el siguiente error :
Ar-SLI_0.6L_-RELEASE.ino: In function 'void Show_RPM_Leds()':
Ar-SLI_0.6L-_RELEASE.ino:163: error: 'TM1638_COLOR_NONE' was not declared in this scope
si antes no ocurría que ha cambiado que ahora si ocurre?
sketch completo :
// Ar-SLI Arduino v0.6L
//
// Must be combined with the Ar-SLI Transmitter app.
//
// RCC (c) 2015 (151206)
#ifdef REVERSE
#include <InvertedTM1638.h>
#else
#include <TM1638.h>
#endif
const int DATA_PIN=8;
const int CLOCK_PIN=9;
const int STROBE_PIN=7;
const int BL_PIN=A0;
#ifdef REVERSE
InvertedTM1638 module(DATA_PIN, CLOCK_PIN, STROBE_PIN);
#else
TM1638 module(DATA_PIN, CLOCK_PIN, STROBE_PIN);
#endif
String inputString = "";
String DisplayString, DotString, LedString, LCDString1, LCDString2;
boolean stringComplete = false;
int Page, Page1Switch, Page2Switch;
byte Button;
void setup() {
Serial.begin(115200);
Page=1;
Page1Switch=1;
Page2Switch=0;
Test_Display();
}
void loop()
{
if (stringComplete) {
ParseBuffer(inputString);
Button = module.getButtons();
if (Button!=0)
{
Serial.print(Button);
delay(100);
}
Show_Display();
Show_RPM_Leds();
inputString = "";
stringComplete = false;
}
}
void serialEvent() {
while (Serial.available()) {
char inChar = (char)Serial.read();
inputString += inChar;
if (inChar == '\n') {
stringComplete = true;
}
}
}
void ParseBuffer(String StrParse)
{
int pos=0;
pos=StrParse.indexOf('\n');
StrParse = StrParse.substring(0,pos);
// Leds
pos=StrParse.indexOf(';');
LedString = StrParse.substring(0,pos);
// Segment Display
StrParse = StrParse.substring(pos+1,StrParse.length());
pos=StrParse.indexOf(';');
DisplayString = StrParse.substring(0,pos);
// Segment Dots
StrParse = StrParse.substring(pos+1,StrParse.length());
pos=StrParse.indexOf(';');
DotString = StrParse.substring(0,pos);
// LCD Line 1
StrParse = StrParse.substring(pos+1,StrParse.length());
pos=StrParse.indexOf(';');
LCDString1 = StrParse.substring(0,pos);
// LCD Line 2
StrParse = StrParse.substring(pos+1,StrParse.length());
pos=StrParse.indexOf(';');
LCDString2 = StrParse.substring(0,pos);
StrParse = StrParse.substring(pos+1,StrParse.length());
}
void Test_Display()
{
module.clearDisplay();
module.setDisplayToString("JUANCHIO",0,0);
delay(1000);
module.setLED(TM1638_COLOR_GREEN, 0);
module.setLED(TM1638_COLOR_GREEN, 7);
delay(100);
module.setLED(TM1638_COLOR_GREEN, 1);
module.setLED(TM1638_COLOR_GREEN, 6);
delay(100);
module.setLED(TM1638_COLOR_GREEN, 2);
module.setLED(TM1638_COLOR_GREEN, 5);
delay(100);
module.setLED(TM1638_COLOR_GREEN, 3);
module.setLED(TM1638_COLOR_GREEN, 4);
delay(100);
module.setLED(TM1638_COLOR_RED, 0);
module.setLED(TM1638_COLOR_RED, 7);
delay(100);
module.setLED(TM1638_COLOR_RED, 1);
module.setLED(TM1638_COLOR_RED, 6);
delay(100);
module.setLED(TM1638_COLOR_RED, 2);
module.setLED(TM1638_COLOR_RED, 5);
delay(100);
module.setLED(TM1638_COLOR_RED, 3);
module.setLED(TM1638_COLOR_RED, 4);
delay(100);
module.setLEDs(0x0000);
delay(2000);
module.clearDisplay();
}
void Show_Display()
{
int Dot = DotString.toInt();
module.setDisplayToString(String(DisplayString),Dot,0);
}
void Show_RPM_Leds ()
{
String Led;
for(int i = 0; i < 8; i++)
{
Led = String(LedString[i]);
if (Led == "0") {
module.setLED(TM1638_COLOR_NONE, i);
} else if (Led == "1") {
module.setLED(TM1638_COLOR_GREEN, i);
} else if (Led == "2") {
module.setLED(TM1638_COLOR_RED, i);
}
}
}