/********* Pleasedontcode.com **********
Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- Terms and Conditions:
You have a non-exclusive, revocable, worldwide, royalty-free license
for personal and commercial use. Attribution is optional; modifications
are allowed, but you're responsible for code maintenance. We're not
liable for any loss or damage. For full terms,
please visit pleasedontcode.com/termsandconditions.
- Project: Button Upload
- Source Code compiled for: Arduino Uno
- Source Code created on: 2023-12-10 11:31:37
********* Pleasedontcode.com **********/
/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
/* upload picture */
/****** END SYSTEM REQUIREMENTS *****/
/****** DEFINITION OF LIBRARIES *****/
#include
#include
/****** FUNCTION PROTOTYPES *****/
void setup(void);
void loop(void);
void uploadPicture(void);
/***** DEFINITION OF DIGITAL INPUT PINS *****/
const uint8_t BUTTON_PIN = 2;
/****** DEFINITION OF LIBRARY CLASS INSTANCES*****/
EasyButton button(BUTTON_PIN);
void setup(void)
{
// put your setup code here, to run once:
pinMode(BUTTON_PIN, INPUT_PULLUP);
// Initialize the button instance
button.begin();
// Attach the uploadPicture function to the button's onPressed event
button.onPressed(uploadPicture);
}
void loop(void)
{
// put your main code here, to run repeatedly:
// Read the button status
button.read();
}
void uploadPicture(void)
{
// Add code here to upload the picture
// This function will be called when the button is pressed
}