Bonjour à tous,
j'essaie de compiler un programme trouvé sur le net
https://www.instructables.com/MQTT-S...ature-Monitor/
j'ai une erreur à la compilation dont je ne connais pas la signification
( le terme 'return' semble pourtant bien noté )
dans ce sous-programme :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 control reaches end of non-void function [-Werror=return-type]
Vos conseils me seraient précieux
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 byte Check_AP_Switch() // returns value depending on how long the AP button is pressed { unsigned long Switch_Pressed_Time; if(digitalRead(AP_Switch) == AP_SwitchOff ) // read & test the button status { // if not pressed Time_Start = millis(); // get time marker in readiness for switch being pressed return 0; } else // switch is ON { while (digitalRead(AP_Switch) == AP_SwitchOn) // wait until button is released { delay(10); Switch_Pressed_Time = millis() - Time_Start; // calculate the time since button was pressed(mS) } // button released //if (EnableMessages) Serial.println(Switch_Pressed_Time); // Diagnostic - button duration time (mS) if(Switch_Pressed_Time >= 1000) return 1; // Wake up Access point if(Switch_Pressed_Time < 1000) return 0; // button not pressed long enough } // end of else // switch is ON } // end of byte Check_AP_Switch()
Mille mercis
Partager