Advertisement
Guest User

Untitled

a guest
Jan 18th, 2015
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <wiringPiI2C.h>
  3. #define devID 0x4c
  4.  
  5. int fd,ec,ec2,adcraw;
  6. int dID = 0x4c;
  7. int main(){
  8.  
  9. fd = wiringPiI2CSetup (dID);
  10.  
  11. ec = wiringPiI2CRead(fd);
  12. ec2 = wiringPiI2CRead(fd);
  13. adcraw = (ec * 256) + ec2;
  14. printf("%i", adcraw);
  15.  
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement