70
current = digitalRead(inPin);
if (current == HIGH && previous == LOW && millis()-
firstTime > 200){
firstTime = millis(); // if the buttons becomes press
remember the time
}
if (current == HIGH && ((millis() - firstTime) % 1000) < 20
&& millis() - firstTime > 500){
ledblink(1, 50, ledPin); // Each second the button is
held blink the indicator led and
count++; // and 1 to the counter
}
if (current == LOW && count >=3 && count < 6){
ledblink(10,200,ledPin); // When the button is released
if the counter is between the two numbers (3-6 blinks or
secs) run the program
// Exit command mode if we haven't already
SPI_Uart_println("");
SPI_Uart_println("exit");
delay(500);
// Enter command mode
SPI_Uart_print("$$$");
delay(500);
SPI_Uart_print("set opt password 0");
delay(500);
Serial.print("Set wlan password to none");
// Set ssid
SPI_Uart_print("set wlan ssid ");
SPI_Uart_println(ssid);
delay(500);
Serial.print("Set wlan ssid to ");
Serial.println(ssid);
Kommentare zu diesen Handbüchern