arduino:gammon-spi-controller
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
arduino:gammon-spi-controller [2023/07/24 16:17] – created mithat | arduino:gammon-spi-controller [2023/07/24 17:45] – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | From [[http:// | + | From [[http:// |
- | <file cpp spi-controller.ino> | + | <file cpp gammon-spi-controller.ino> |
// Written by Nick Gammon | // Written by Nick Gammon | ||
// February 2011 | // February 2011 | ||
+ | // With Mithat Mods -- July 2023 | ||
#include < | #include < | ||
Line 10: | Line 10: | ||
void setup (void) | void setup (void) | ||
{ | { | ||
- | |||
digitalWrite(SS, | digitalWrite(SS, | ||
Line 19: | Line 18: | ||
// Slow down the master a bit | // Slow down the master a bit | ||
- | SPI.setClockDivider(SPI_CLOCK_DIV8); | + | |
| | ||
} // end of setup | } // end of setup | ||
Line 26: | Line 25: | ||
void loop (void) | void loop (void) | ||
{ | { | ||
- | |||
char c; | char c; | ||
Line 34: | Line 32: | ||
// send test string | // send test string | ||
for (const char * p = " | for (const char * p = " | ||
+ | { | ||
SPI.transfer (c); | SPI.transfer (c); | ||
+ | delayMicroseconds(5); | ||
+ | } | ||
// disable Slave Select | // disable Slave Select |
arduino/gammon-spi-controller.txt · Last modified: 2023/07/24 18:43 by mithat