Guest User

Untitled

a guest
Nov 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include "mbed.h"
  2.  
  3. AnalogOut Aout(p18); //create an analog output on pin 18
  4.  
  5.  
  6. void out1(float vol)
  7. {
  8. Aout = vol;
  9. wait_us(100);
  10. }
  11.  
  12. int main()
  13. {
  14. int vol;
  15. while(1)
  16. {
  17. for(vol = 0; vol <10; vol++)
  18. {
  19. out1(vol*0.1);
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment