yoshinari kou
/
TEST_WW_SPI_CS
White Wizard SPI Chip Select test program. I changed chip select signal timing.
Diff: main.cpp
- Revision:
- 1:048ae028f72d
- Parent:
- 0:1d2148b42390
--- a/main.cpp Mon Jul 25 10:00:33 2011 +0000 +++ b/main.cpp Mon Jul 25 10:01:36 2011 +0000 @@ -1,26 +1,26 @@ -#include "mbed.h" -#include "wwChipSelect.h" - -//Nest Egg Inc. -//http://nestegg.jp/ -//channel No must be A1 A2 A3 A4 -//#define ch_num 0x05 //channel No 0101, depend on your SPI module setting. -#define ch_num 0x0A //channel No 1010, depend on your SPI module setting. -#define reset_ch 0x00 //channel No 0000, for reset. - -DigitalOut myled(LED1); - -int main() { - - wwChipSelect wwcs(p8); - - while(1) { - wwcs.wwCSwrite(ch_num); - myled = 1; - wait(0.2); - - wwcs.wwCSwrite(reset_ch); - myled = 0; - wait(0.2); - } -} +#include "mbed.h" +#include "wwChipSelect.h" + +//Nest Egg Inc. +//http://nestegg.jp/ +//channel No must be A1 A2 A3 A4 +//#define ch_num 0x05 //channel No 0101, depend on your SPI module setting. +#define ch_num 0x0A //channel No 1010, depend on your SPI module setting. +#define reset_ch 0x00 //channel No 0000, for reset. + +DigitalOut myled(LED1); + +int main() { + + wwChipSelect wwcs(p8); + + while(1) { + wwcs.wwCSwrite(ch_num); + myled = 1; + wait(0.2); + + wwcs.wwCSwrite(reset_ch); + myled = 0; + wait(0.2); + } +}