Skip to content

Instantly share code, notes, and snippets.

View AmazingRoovy's full-sized avatar
🍏
Focusing

Alexey Abakhtimov AmazingRoovy

🍏
Focusing
  • Moscow Polytechnic University
  • Russian Federation, Moscow
View GitHub Profile
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>
#include <iostream>
using namespace std;
void swap(int &a, int &b) {
int tmp = a;
a = b;
b = tmp;
}