Hola amigos,
Os traigo un reto, he usado varios programas para guardar los datos que recojo del del arduino pero todos son tercerizados como Realterm, Processing, Ruby, Excel, u otros, pero no encuentro cómo grabar los datos directamente de los que se genera en el Monitor Serial.
Osea lo que busco es ampliar mi código para que instruya a mi PC a guardar los datos, alguien conoce cómo hacer esto.
Mi código es un simple contador de pulsos de un push bottom.
Gracias de antemano.
<
// this constant won't change:
const int buttonPin = A2; // the pin that the pushbutton is attached to
const int ledPin = 9; // the pin that the LED is attached to
// Variables will change:
int Total; // counter for the number of button presses
int EstadoInicial = 0; // current state of the button
int nuevoEstadoInicial = 0; // previous state of the button
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
}
void loop()
{
// read the pushbutton input pin:
EstadoInicial = digitalRead(buttonPin);
// compare the EstadoInicial to its previous state
if (EstadoInicial != nuevoEstadoInicial) {
// if the state has changed, increment the counter
if (EstadoInicial == 0) {
// if the current state is 0 then the button went from on to total:
Total++;
Serial.print(Total);
Serial.println(",");
} else
{
for (int EstadoInicial = 0; nuevoEstadoInicial <= 100; Total) // mostrar solo los valores resultantes,
delay(10);// Delay a little bit to avoid bouncing
}
for (int nuevoEstadoInicial = 0; EstadoInicial >= 0; Total)
}
if (nuevoEstadoInicial > 0) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}