Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. // In setup()
  2. attachInterrupt(1, adcIsr, RISING);
  3. }
  4.  
  5. volatile bool dataReady = false;
  6.  
  7. void adcIsr()
  8. {
  9. dataReady = true;
  10. }
  11.  
  12. loop()
  13. {
  14. if (dataReady)
  15. {
  16. Serial.println(adc.readADC());
  17. dataReady = false;
  18. }
  19. }
  20.  
  21. writeReg(OTP_B1, 0x30);
  22. writeReg(PGA, PGA_OUTPUT_BUFFER_ENABLE | PGA_PGACHPDIS);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement