baldengineer

Sawtooth waveform with Arduino Due

Feb 7th, 2013
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. // Public Domain
  2. // More information: http://www.cmiyc.com/blog/2013/02/07/sawtooth-waveform-with-the-arduino-dues-built-in-dac/
  3.  
  4. void setup() {
  5. // None, analogWrite() sets up pin state
  6. }
  7.  
  8. void loop() {
  9.   // Simple sawtooth waveform
  10.   for(int x=0; x<255; x++) {
  11.     analogWrite(DAC0, x);
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment