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: LED Control
- - Source Code NOT compiled for: Arduino Nano ESP32
- - Source Code created on: 2025-07-19 15:21:29
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* turn on led on esp 32 itelf after i press button */
- /* on remotexy */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- // You need to include the RemoteXY library for the control interface
- #include <RemoteXY.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /* USER CODE START */
- uint8_t RemoteXY_CONF[] = // 29 bytes
- { 255,1,0,0,0,22,0,19,0,0,0,0,31,1,106,200,1,1,1,0,
- 1,47,67,24,24,0,2,31,0 };
- // this structure defines all the variables and events of your control interface
- struct {
- // input variables
- uint8_t button_01; // =1 if button pressed, else =0
- // other variable
- uint8_t connect_flag; // =1 if wire connected, else =0
- } RemoteXY;
- // Define the built-in LED pin for ESP32 (usually GPIO 2)
- const int ledPin = 2;
- /* USER CODE END */
- void setup(void)
- {
- // put your setup code here, to run once:
- RemoteXY_Init(); // Initialize RemoteXY interface
- pinMode(ledPin, OUTPUT); // Initialize the LED pin as output
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- RemoteXY_Handler(); // Handle RemoteXY communication
- // Turn on LED if button is pressed
- if (RemoteXY.button_01 == 1) {
- digitalWrite(ledPin, HIGH); // Turn on the built-in LED
- } else {
- digitalWrite(ledPin, LOW); // Turn off the built-in LED
- }
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment