LoRaGateway_BTS2A/SPI_test/SPI_test.ino

19 lines
336 B
Arduino
Raw Normal View History

2018-04-12 14:55:36 +02:00
#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);
}