LoRaGateway_BTS2A/SPI_test/SPI_test.ino
flavienhaas e49d11c98d MAJ SPI
2018-04-12 14:55:36 +02:00

19 lines
336 B
C++

#include <SPI.h>
#define ss 10
void setup() {
SerialUSB.begin(9600);
pinMode(ss, OUTPUT);
SPI.begin(); //initiate the SPI communicaton
SPI.setBitOrder(MSBFIRST);
}
void loop() {
digitalWrite(ss, LOW);
SPI.transfer(0x02);
digitalWrite(ss, HIGH);
SerialUSB.println("0x02 sent");
SPI.endTransaction();
delay(1000);
}