Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/********* 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: Input Setup - Source Code compiled for: Arduino Uno - Source Code created on: 2024-03-17 18:42:47 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* using Arduino Mega, 28byj-48, IR Speed sensor, I2C */ /* LCD Display 16x2, forward limit switch, and */ /* reverse limit switch. By creating a Navigation */ /* menu through a rotary encoder(HW-040). */ /****** END SYSTEM REQUIREMENTS *****/ /****** DEFINITION OF LIBRARIES *****/ #include
//https://github.com/evert-arias/EasyButton #include
// For I2C communication #include
// For LCD display /****** FUNCTION PROTOTYPES *****/ void setup(void); void loop(void); /***** DEFINITION OF DIGITAL INPUT PINS *****/ const uint8_t button_PushButton_PIN_D2 = 2; const uint8_t limitSwitch_Forward_PIN = 3; const uint8_t limitSwitch_Reverse_PIN = 4; const uint8_t rotaryEncoder_CLK_PIN = 5; const uint8_t rotaryEncoder_DT_PIN = 6; const uint8_t rotaryEncoder_SW_PIN = 7; const uint8_t speedSensor_PIN = 8; /****** DEFINITION OF LIBRARIES CLASS INSTANCES *****/ EasyButton button_PushButton(button_PushButton_PIN_D2); LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 columns, 2 rows void setup(void) { // put your setup code here, to run once: pinMode(button_PushButton_PIN_D2, INPUT_PULLUP); pinMode(limitSwitch_Forward_PIN, INPUT_PULLUP); pinMode(limitSwitch_Reverse_PIN, INPUT_PULLUP); pinMode(rotaryEncoder_CLK_PIN, INPUT_PULLUP); pinMode(rotaryEncoder_DT_PIN, INPUT_PULLUP); pinMode(rotaryEncoder_SW_PIN, INPUT_PULLUP); pinMode(speedSensor_PIN, INPUT); // Initialize the EasyButton object with the pin number button_PushButton.begin(); // Initialize the LCD display lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Navigation Menu"); } void loop(void) { // put your main code here, to run repeatedly: // Call the EasyButton read() function to check for button events if (button_PushButton.read()) { // Button is pressed // Add your code here to handle the button press event } // Add your code here to read the other inputs and handle the navigation menu }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)