Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* 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 Interaction
- - Source Code compiled for: Arduino Nano
- - Source Code created on: 2023-12-14 21:30:51
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Convert an int variable 1234 in string and print */
- /* on serial monitor */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- #include <EasyButton.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(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:
- Serial.begin(115200);
- pinMode(BUTTON_PIN, INPUT_PULLUP);
- button.begin();
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- button.read();
- if (button.isPressed())
- {
- Serial.println("Button has been pressed");
- // Add your logic here to handle the button press event
- // ...
- }
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- // Convert an int variable 1234 to string and print on the serial monitor
- int num = 1234;
- String numString = String(num);
- Serial.println(numString);
- /****** END SYSTEM REQUIREMENTS *****/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement