Advertisement
pleasedontcode

"LED Control" rev_01

Nov 19th, 2024
76
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: "LED Control"
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-11-19 14:24:49
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* if typed 1 in terminal then led turns on and if */
  21.     /* typed 0 it goes off */
  22. /****** END SYSTEM REQUIREMENTS *****/
  23.  
  24. /* START CODE */
  25.  
  26. /****** DEFINITION OF LIBRARIES *****/
  27. #include <SoftwareSerial.h>
  28.  
  29. /****** FUNCTION PROTOTYPES *****/
  30. void setup(void);
  31. void loop(void);
  32. void updateOutputs(void); // Added function prototype for updateOutputs
  33.  
  34. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  35. const uint8_t dede_LED_PIN_D2 = 2;
  36. const int ledPin = 13; // Added USER CODE for another LED pin
  37.  
  38. /***** DEFINITION OF Software Serial *****/
  39. const uint8_t blueblue_HC05_mySerial_PIN_SERIAL_TX_A0 = A0;
  40. const uint8_t blueblue_HC05_mySerial_PIN_SERIAL_RX_A1 = A1;
  41. SoftwareSerial blueblue_HC05_mySerial(blueblue_HC05_mySerial_PIN_SERIAL_RX_A1, blueblue_HC05_mySerial_PIN_SERIAL_TX_A0);
  42.  
  43. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  44. /***** used to store raw data *****/
  45. bool dede_LED_PIN_D2_rawData = 0;
  46.  
  47. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  48. /***** used to store data after characteristic curve transformation *****/
  49. float dede_LED_PIN_D2_phyData = 0.0;
  50.  
  51. void setup(void)
  52. {
  53.     // put your setup code here, to run once:
  54.     pinMode(dede_LED_PIN_D2, OUTPUT);
  55.     pinMode(ledPin, OUTPUT); // Set up the additional LED pin
  56.  
  57.     blueblue_HC05_mySerial.begin(9600);
  58.     Serial.begin(9600); // Set baud rate to 9600 for Serial communication (added from USER CODE)
  59. }
  60.  
  61. void loop(void)
  62. {
  63.     // put your main code here, to run repeatedly:
  64.     updateOutputs(); // Refresh output data
  65.  
  66.     if (Serial.available() > 0) { // Added from USER CODE
  67.         char data = Serial.read(); // Read data from Serial
  68.         if (data == '1') {
  69.             digitalWrite(ledPin, HIGH); // Turn additional LED on
  70.         } else if (data == '0') {
  71.             digitalWrite(ledPin, LOW); // Turn additional LED off
  72.         }
  73.     }
  74. }
  75.  
  76. void updateOutputs()
  77. {
  78.     digitalWrite(dede_LED_PIN_D2, dede_LED_PIN_D2_rawData);
  79. }
  80.  
  81. /* END CODE */
Advertisement
Comments
  • jonsonsmith1911
    14 days
    # text 1.36 KB | 0 0
    1. https://pastebin.com/pkErZ3rk
    2. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730610511506--For-100-QuiK-Help-How-Do-I-Contact-QuickBooks-Desktop-Support
    3. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730695684754--Official-iNTUiT-How-Do-I-Contact-QuickBooks-Enterprise-Support
    4. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730753993874--QB-Connect-What-is-the-QuickBooks-Payroll-Error-SuPPort-NumBer
    5. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730796093330-Contact-Intuit-How-Do-I-Contact-QuickBooks-Payroll-Support-by-Phone-Number
    6. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730777254930--QB-EXpert-Guide-What-Is-QuickBooks-Enterprise-Support-Number-Official-Support
    7. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730832192530--QB-HELP-How-Do-I-Contact-Intuit-QuickBooks-Enterprise-Support-Number
    8. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730849834514--FAQ-GUIDE-How-do-I-communicate-with-QuickBooks-Enterprise-Support
    9. https://b2bservice.fatboy.com/hc/en-us/community/posts/22730837448594--Intuit-Help-How-to-contact-Support-Enterprise-Support-Number-Support-TollFree
    10. https://network.propertyweek.com/members/JonsonBaba
    11. https://educat.xtec.cat/members/JonsonBaba
    12. https://www.ssplace.miami.edu/members/JonsonBaba
    13. https://sloan.ucr.edu/members/JonsonBaba
    14. https://zagspace.gonzaga.edu/members/JonsonBaba
Add Comment
Please, Sign In to add comment
Advertisement