Hello everyone, i have a coding question… I am currently doing a project about positioning. I am using the Processing application to display the movements and the coordinates of my device, also i’ve added some extra features ( creating a flight path ) As you can see below…
But now i am thinking is it possible to store the information when an external trigger is being input-ed by the user in the serial monitor.
char rx_byte = 0;
int z;
coordinates_t coor;
int a = coor.x;
int b = coor.y;
int c = coor.z;
const coordinates_t SavedCoordinates[] PROGMEM = {};
if (Serial.available() > 0) { // is a character available?
rx_byte = Serial.read(); // get the character
if ((rx_byte == '1')) {
Serial.print(" START RECORDING \n");
const coordinates_t SavedCoordinates[] PROGMEM = {};
}
else if (rx_byte == '2'){
Serial.println(" STOP RECORDING ");
}
else
{
Serial.println(" Invalid Input ");
}
}
coor.x, coor.y and coor.z is the variables that hold my coordinates value… I was thinking when the user input a ’ 1’ into the serial monitor the " START RECORDING " words will be printed in the serial monitor and wherever i move my device, ALL the coordinates will be stored inside the memory of the board ( it can be any memory, it can be flash,SRAM, EEPROM ) until a ‘2’ is input-ed and the " STOP RECORDING " is printed. Meaning all the coordinates data in between the start and stop recording is to be saved in the internal memory… Any one knows if it is possible.? please help me … Thank you very much