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 Control
- - Source Code compiled for: Arduino Uno
- - Source Code created on: 2024-01-16 12:32:35
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* turn off and on light every type of line just */
- /* follow */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- #include <EasyButton.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup();
- void loop();
- /***** DEFINITION OF DIGITAL INPUT PINS *****/
- const uint8_t g_PushButton_PIN_D2 = 2;
- const uint8_t g_PushButton_PIN_D3 = 3;
- /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
- EasyButton button1(g_PushButton_PIN_D2);
- EasyButton button2(g_PushButton_PIN_D3);
- void setup()
- {
- // put your setup code here, to run once:
- pinMode(g_PushButton_PIN_D2, INPUT_PULLUP);
- pinMode(g_PushButton_PIN_D3, INPUT_PULLUP);
- button1.begin();
- button2.begin();
- }
- void loop()
- {
- // put your main code here, to run repeatedly:
- button1.read();
- button2.read();
- // System Requirement 1: Turn off and on light for every type of line just follow
- if (button1.isPressed())
- {
- // Code to turn on the light
- }
- else if (button2.isPressed())
- {
- // Code to turn off the light
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement