Guest User

Untitled

a guest
Dec 13th, 2017
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. int start_I2C(){
  2. if (gpioInitialise() < 0) {
  3. std::cout << "Initialization of GPIO faieldn";
  4. return -1;
  5. }
  6. xfer.control = ( I2C_ADDR << 16 ) | 0x305;
  7. if ( bscXfer( &xfer ) < 0){
  8. std::cout << "Errors on I2C.cpp on function bscXfer()n";
  9. return -1;
  10. }
  11. memset( xfer.rxBuf, '', sizeof(char)*BSC_FIFO_SIZE );
  12. xfer.rxCnt = 0;
  13. xfer.txCnt = 0;
  14. std::cout << "Raspberry Pi I2C OK!n";
  15. return 0;
  16. }
  17.  
  18. 2017-12-14 00:24:55 initCheckPermitted:
  19. +---------------------------------------------------------+
  20. |Sorry, you don't have permission to run this program. |
  21. |Try running as root, e.g. precede the command with sudo. |
  22. +---------------------------------------------------------+
  23.  
  24.  
  25. Initialization of GPIO faield
Add Comment
Please, Sign In to add comment