Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mbed.h"
- CAN can(NC, NC);
- DigitalOut chipsel(P2_0);
- int main() {
- // Init CAN
- can.frequency(125000);
- // Main loop
- SPI device(P2_3, P2_2, P2_1);
- device.frequency(1000000);
- device.format(16,2); // 16 bits
- chipsel = 0;
- chipsel = 1;
- float response;
- while(1) {
- response = device.write(0xFFFF);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement