EasyManuals Logo

Freenove Ultimate Starter Kit User Manual

Freenove Ultimate Starter Kit
286 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #68 background imageLoading...
Page #68 background image
Chapter 2 Button & LED
68
www.freenove.com
support@freenove.com
if(millis() - lastChangeTime > captureTime){
//if button state is changed ,update the data.
if(reading != buttonState){
buttonState = reading;
Finally, judge the state of Button. And if it is low level, the changing state indicates that the button is pressed,
if the state is high level, then the button is released. Here, we change the status of the LED variable, and then
update the state of LED.
if(buttonState == LOW){
printf("Button is pressed!\n");
ledState = !ledState;
if(ledState){
printf("turn on LED ...\n");
}
else {
printf("turn off LED ...\n");
}
}
//if the state is high ,the action is releasing
else {
printf("Button is released!\n");
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Freenove Ultimate Starter Kit and is the answer not in the manual?

Freenove Ultimate Starter Kit Specifications

General IconGeneral
BrandFreenove
ModelUltimate Starter Kit
CategorySingle board computers
LanguageEnglish