Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- // The setup() function runs once each time the micro-controller starts
- void setup()
- {
- //Initialize serial and wait for port to open:
- Serial.begin(9600);
- while (!Serial) {
- ; // wait for serial port to connect. Needed for native USB
- }
- /*
- test area
- *//*
- SPI.begin(52); // SPI Module 'wake up'
- SPI.setClockDivider(52, SPI_CLOCK_DIV128 );
- SPI.setDataMode(52, SPI_MODE0);
- SPI.setBitOrder(52, MSBFIRST);
- delay(200); // SPI delay for initialization
- */
- SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0)); // SPI setup SPI communication
- SPI.begin(52);
- while (true)
- {
- SPI.transfer(52, 0xAA, SPI_LAST);
- delay(20);
- }
- }
- void loop()
- {
- }
- SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
- delay(200);
- SPI.begin();
- SPI.transfer(0xAA);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement