Hello everybody i wish you all fine, I need a help in my project , My project is a race. At the starting point, I want to save the location that I am in. If I cross the starting point again, I want it to be sent and count in the serial monitor i= 1. The end is seven rounds, and if I reach the last round, I want to alert by buzzer. I will save the starting point by pressing a push button. my code below
#include<SoftwareSerial.h>
SoftwareSerial NEO6M(2,3);
int buzzer = 7;
int buttonState = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
NEO6M.begin(9600);
pinMode(6, INPUT);
pinMode(buzzer, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(6);
while(NEO6M.available()>0){
Serial.write(NEO6M.read());
}
}
thank you