Advertisement
pleasedontcode

"Arduino Control" rev_01

Dec 28th, 2023
71
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: "Arduino Control"
  13.     - Source Code compiled for: Arduino Mega
  14.     - Source Code created on: 2023-12-28 17:16:42
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* A digital control system is described by the */
  21.     /* difference equation  y(n) = 0.5 y(n-2) – 0.5 */
  22.     /* y(n-4) + x(n) + x(n-2).  (i) Determine the */
  23.     /* frequency response for the system. */
  24. /****** END SYSTEM REQUIREMENTS *****/
  25.  
  26. /****** DEFINITION OF LIBRARIES *****/
  27. #include <Arduino.h>
  28. #include <EasyButton.h>
  29.  
  30. /****** FUNCTION PROTOTYPES *****/
  31. void setup(void);
  32. void loop(void);
  33.  
  34. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  35. const uint8_t mybutton_PushButton_PIN_D2 = 2;
  36.  
  37. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  38. EasyButton myButton(mybutton_PushButton_PIN_D2);
  39.  
  40. /****** SYSTEM REQUIREMENTS *****/
  41. /****** SYSTEM REQUIREMENT 1 *****/
  42.   /* A digital control system is described by the */
  43.   /* difference equation y(n) = 0.5 y(n-2) - 0.5 */
  44.   /* y(n-4) + x(n) + x(n-2). (i) Determine the */
  45.   /* frequency response for the system. */
  46. /****** END SYSTEM REQUIREMENTS *****/
  47.  
  48. void setup(void)
  49. {
  50.   // put your setup code here, to run once:
  51.   Serial.begin(9600);
  52.   myButton.begin();
  53. }
  54.  
  55. void loop(void)
  56. {
  57.   // put your main code here, to run repeatedly:
  58.   myButton.read();
  59.  
  60.   if (myButton.isPressed())
  61.   {
  62.     Serial.println("Button has been pressed");
  63.   }
  64. }
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement