Advertisement
claudiusmarius

ESP32SIWAVE0002_AnnexeRampeXIAO

Nov 13th, 2022
777
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.52 KB | None | 1 0
  1. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++SEEEDUINO XIAO génrateur de triangle pour moduler l'ESP32+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2.   //+++++++++++++++++++++++++++++++++++++++++++++++A UTILISER AVEC LE CODE ESP32SIWAVE0002_AnnexeRampeXIAO POUR LE SEEDUINO XIAO+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3.   //==================================================================claude.dufourmont@laposte.net======================================================================================
  4.   //===========================================================https://www.youtube.com/c/ClaudeDufourmont================================================================================
  5.   //..........Ce petit dispositif est très intéressant en tant que petit générateur BF de labo, personnellement je le garde monté sur breadboard (en incluant ou pas les MCU)............
  6.   //===========================================================================FONCTIONNE================================================================================================  
  7.  
  8.  
  9.   #define DAC_PIN A0
  10.   int i =0;
  11.  
  12.   void setup()
  13.   {
  14.   analogWriteResolution(10); // Set analog out resolution to max, 10-bits
  15.   analogReadResolution(12); // Set analog input resolution to max, 12-bits
  16.   }
  17.  
  18.   void loop()
  19.   {
  20.   for (int i = 0; i <= 950; i = i + 1)
  21.   {
  22.   analogWrite (A0,i);
  23.   delay (5);
  24.   }
  25.      
  26.   for (int i = 950; i >= 0; i = i - 1) {
  27.   analogWrite (A0,i);
  28.   delay (5);
  29.   }
  30.  
  31.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement