Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. int nSmpl = 1, sample; // global variables
  2.  
  3. void setup()
  4. {
  5.   Serial.begin(9600);
  6.   Serial.print("\nsmpl\tADC\n"); // column headers
  7. }
  8. void loop()
  9. {
  10.   sample = analogRead(A0);
  11.   Serial.print(nSmpl); Serial.print('\t'); // tabbed output
  12.   Serial.println(sample);
  13.   ++nSmpl;
  14.   delay(500);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement