Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <SPI.h>
  2. // The setup() function runs once each time the micro-controller starts
  3. void setup()
  4. {
  5. //Initialize serial and wait for port to open:
  6. Serial.begin(9600);
  7. while (!Serial) {
  8. ; // wait for serial port to connect. Needed for native USB
  9. }
  10. /*
  11. test area
  12. *//*
  13. SPI.begin(52); // SPI Module 'wake up'
  14. SPI.setClockDivider(52, SPI_CLOCK_DIV128 );
  15. SPI.setDataMode(52, SPI_MODE0);
  16. SPI.setBitOrder(52, MSBFIRST);
  17. delay(200); // SPI delay for initialization
  18. */
  19. SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0)); // SPI setup SPI communication
  20. SPI.begin(52);
  21.  
  22. while (true)
  23. {
  24. SPI.transfer(52, 0xAA, SPI_LAST);
  25. delay(20);
  26. }
  27. }
  28.  
  29. void loop()
  30. {
  31. }
  32.  
  33. SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
  34. delay(200);
  35. SPI.begin();
  36. SPI.transfer(0xAA);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement