Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- int rx = 0;
- // The setup() function runs after reset.
- void setup() {
- // Initialize serial for DEBUG.
- Serial.begin(9600);
- SPI.begin();
- }
- // The loop() function runs continuously after setup().
- void loop() {
- digitalWrite(SS, LOW);
- delay(20);
- // Send check
- SPI.transfer("check");
- // Wait for slave.
- delay(20);
- // Get slave response.
- rx = SPI.transfer(0);
- Serial.println (rx);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement