Olá

eu estou enviando um numero na serial, mas não esta gravando na eeprom, porque ?

Estou fazendo assim

int c = Serial.read();

EEPROM.write(0x01, c);

Delay(100);

Valew

Exibições: 114

Respostas a este tópico

Eu fiz assim e funcionou:

#include <EEPROM.h>

String c;
int valor;

void setup() {

  Serial.begin(9600);
}

void loop() {
   if(Serial.available()) {
     {
       c = String("");
       while(Serial.available())
       {
         c = c + char(Serial.read());
       }
       valor = c.toInt();
     }
     EEPROM.write(0x01, valor);
     Serial.print("Gravou: ");
     Serial.println(valor);
   }
   delay(1000);
}

RSS

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço