Advertisement
claudiusmarius

RampeSeeeduino00

Sep 4th, 2023
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. //RampeSeeeduino00
  2.   //https://youtu.be/GksWC8m5Iwo
  3.   //https://www.youtube.com/c/ClaudeDufourmont
  4.   //Signal TRIANGLE simple sur sortie DAC pour modulation en amplitude signal 20KHz
  5.   //========================================================================================================
  6.   //                                            CLAUDE DUFOURMONT                                         //
  7.   //========================================================================================================
  8.   void setup()
  9.   {
  10.   pinMode(A0, OUTPUT);
  11.   analogWriteResolution(12);
  12.   }
  13.  
  14.   void loop()
  15.   {
  16.   genererTriangle();
  17.   }
  18.  
  19.   void genererTriangle()
  20.   {
  21.   for (int i = 0; i < 180; i++)
  22.   {
  23.   analogWrite(A0, i);
  24.   //delay(1);
  25.   }
  26.  
  27.   for (int i = 180; i > 0; i--)
  28.   {
  29.   analogWrite(A0, i);
  30.   //delay(1);
  31.   }
  32.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement