Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "TimerOne.h"
- int adcVal = 0;
- int adcPin = 0;
- void setup() {
- Serial.begin(115200);
- Serial.println("Initializing Butterwerx DAQ ...");
- // put your setup code here, to run once:
- Timer1.initialize(50000);
- Timer1.attachInterrupt(timer1Callback);
- pinMode(A0, INPUT);
- }
- void timer1Callback(){
- Serial.println(adcVal);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- adcVal = analogRead(A0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement