Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include "mbed.h"
  2.  
  3. CAN can(NC, NC);
  4. DigitalOut chipsel(P2_0);
  5.  
  6.  
  7. int main() {
  8. // Init CAN
  9. can.frequency(125000);
  10. // Main loop
  11. SPI device(P2_3, P2_2, P2_1);
  12. device.frequency(1000000);
  13. device.format(16,2); // 16 bits
  14. chipsel = 0;
  15. chipsel = 1;
  16. float response;
  17.  
  18. while(1) {
  19. response = device.write(0xFFFF);
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement