Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include "TimerOne.h"
  2.  
  3. int adcVal = 0;
  4. int adcPin = 0;
  5.  
  6. void setup() {
  7.  
  8. Serial.begin(115200);
  9. Serial.println("Initializing Butterwerx DAQ ...");
  10. // put your setup code here, to run once:
  11. Timer1.initialize(50000);
  12. Timer1.attachInterrupt(timer1Callback);
  13.  
  14. pinMode(A0, INPUT);
  15.  
  16.  
  17. }
  18.  
  19. void timer1Callback(){
  20.  
  21.  
  22. Serial.println(adcVal);
  23. }
  24.  
  25. void loop() {
  26. // put your main code here, to run repeatedly:
  27. adcVal = analogRead(A0);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement