You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
336 B
C++
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);
|
|
}
|