mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-06 10:07:01 +01:00
add SPI example
This commit is contained in:
25
libraries/SPI/examples/basic/basic.ino
Normal file
25
libraries/SPI/examples/basic/basic.ino
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "SPI.h"
|
||||
|
||||
SPIClass spi0(SPI0);
|
||||
#ifdef K210
|
||||
#error "11111111"
|
||||
#else
|
||||
#error "222222"
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
{
|
||||
spi0.setFrequency(10000000);
|
||||
spi0.begin(27, 26, 28, 29);
|
||||
spi0.transfer(1);
|
||||
spi0.transfer(2);
|
||||
spi0.transfer(3);
|
||||
spi0.transfer(0xEE);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user