Send data with SPI.

Dependencies:   mbed

Committer:
arostm
Date:
Wed Jun 07 14:08:05 2017 +0000
Revision:
1:e6112104a80f
Parent:
0:21b36798fd00
Adding new mbed library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:21b36798fd00 1 #include "mbed.h"
bcostm 0:21b36798fd00 2
bcostm 0:21b36798fd00 3 SPI device(SPI_MOSI, SPI_MISO, SPI_SCK);
bcostm 0:21b36798fd00 4
bcostm 0:21b36798fd00 5 int main() {
bcostm 0:21b36798fd00 6 int i = 0;
bcostm 0:21b36798fd00 7 while(1) {
bcostm 0:21b36798fd00 8 device.write(0x55);
bcostm 0:21b36798fd00 9 device.write(i++);
bcostm 0:21b36798fd00 10 device.write(0xE0);
bcostm 0:21b36798fd00 11 wait_us(50);
bcostm 0:21b36798fd00 12 }
bcostm 0:21b36798fd00 13 }
bcostm 0:21b36798fd00 14