Advertisement
pleasedontcode

asd rev_08

Sep 13th, 2023
87
0
Never
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: asd
  13.     - Source Code compiled for: Arduino Pro Mini 5V
  14.     - Source Code created on: 2023-09-13 16:16:34
  15.     - Source Code generated by: AlexWind
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <GRGB.h>
  21. #include <SerialManager.h>
  22.  
  23. /****** SYSTEM REQUIREMENT 1 *****/
  24. /* activate three leds to manage a traffic light */
  25. /****** SYSTEM REQUIREMENT 2 *****/
  26. /* Spegni led */
  27.  
  28. /****** FUNCTION PROTOTYPES *****/
  29. void setup(void);
  30. void loop(void);
  31.  
  32. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  33. const uint8_t eccolo_PushButton_PIN_D5 = 5;
  34.  
  35. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  36. const uint8_t rbg_LEDRGB_Red_PIN_D2 = 2;
  37. const uint8_t rbg_LEDRGB_Green_PIN_D3 = 3;
  38. const uint8_t rbg_LEDRGB_Blue_PIN_D4 = 4;
  39.  
  40. /****** FUNCTION PROTOTYPES *****/
  41. static void activateTrafficLight();
  42. static void turnOffLEDs();
  43.  
  44. void setup(void)
  45. {
  46.     // put your setup code here, to run once:
  47.     pinMode(eccolo_PushButton_PIN_D5, INPUT_PULLUP);
  48.  
  49.     pinMode(rbg_LEDRGB_Red_PIN_D2, OUTPUT);
  50.     pinMode(rbg_LEDRGB_Green_PIN_D3, OUTPUT);
  51.     pinMode(rbg_LEDRGB_Blue_PIN_D4, OUTPUT);
  52. }
  53.  
  54. void loop(void)
  55. {
  56.     // put your main code here, to run repeatedly:
  57. }
  58.  
  59. /**
  60.  * @brief Activates three LEDs to manage a traffic light.
  61.  */
  62. static void activateTrafficLight()
  63. {
  64.     digitalWrite(rbg_LEDRGB_Red_PIN_D2, HIGH);
  65.     digitalWrite(rbg_LEDRGB_Green_PIN_D3, HIGH);
  66.     digitalWrite(rbg_LEDRGB_Blue_PIN_D4, HIGH);
  67. }
  68.  
  69. /**
  70.  * @brief Turns off all LEDs.
  71.  */
  72. static void turnOffLEDs()
  73. {
  74.     digitalWrite(rbg_LEDRGB_Red_PIN_D2, LOW);
  75.     digitalWrite(rbg_LEDRGB_Green_PIN_D3, LOW);
  76.     digitalWrite(rbg_LEDRGB_Blue_PIN_D4, LOW);
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement