brilliant hack to make everything work...

This commit is contained in:
Diogo Cordeiro 2019-04-04 18:12:45 +01:00
parent dff282567d
commit 2f2b6af671
2 changed files with 7 additions and 1 deletions

View File

@ -49,7 +49,9 @@ ESP8266WebServer webServer(80);
#define NLEDS 6 #define NLEDS 6
// LEDs board outputs // LEDs board outputs
int bits[NLEDS] = { D0, D1, D2, D3, D4, D5 }; // Orange, Yellow, Green, Blue, Purple, Gray
// D0 D1 D2 D5 D6 D7
int bits[NLEDS] = { D2, D3, D4, D5, D6, D7 };
// Memorizes bits state // Memorizes bits state
int current_answer[NLEDS] = { 0 }; int current_answer[NLEDS] = { 0 };
@ -246,6 +248,8 @@ switch_led()
} }
int incomingByte = webServer.arg("led").toInt(); int incomingByte = webServer.arg("led").toInt();
Serial.print("Mandaram-me alterar o estado da lampada: ");
Serial.println(incomingByte);
if (incomingByte >= NLEDS || incomingByte < 0) if (incomingByte >= NLEDS || incomingByte < 0)
{ {
@ -306,6 +310,8 @@ generate_password()
void void
print_binary_string(String which) print_binary_string(String which)
{ {
Serial.print("Eu estou a imprimir esta string: ");
Serial.println(which);
for (int i = 0; i < NLEDS; ++i) for (int i = 0; i < NLEDS; ++i)
{ {
if (which.charAt(i) == '1') if (which.charAt(i) == '1')