Terry Lung
/
Post_2
524APP
Fork of Post_2 by
Diff: main.cpp
- Revision:
- 1:a100355f82ff
- Parent:
- 0:c0bf253f46e0
--- a/main.cpp Thu May 24 11:20:14 2018 +0000 +++ b/main.cpp Tue Nov 06 03:26:45 2018 +0000 @@ -1,32 +1,12 @@ -#include "mbed.h" +#include "mbed-os.h" -DigitalOut led(LED2); -SPI spi(D11, D12, D13); // mosi, miso, sclk -DigitalOut CS(D8); - -Serial pc(PC_6, PC_7); +//DigitalOut led2(LED2); +//DigitalOut led1(LED1); int main() { - // specify period first - led = 1; - spi.format(8,3); - spi.frequency(2000000); - CS = 1; - - pc.baud(2000000); - - while(1) - { - //CS = 0; - //spi.write(0x8F); - //spi.write(0x00); - //CS = 1; - pc.printf("5"); - - } - // 4 second period - //led.write(0.5f); // 50% duty cycle, relative to period - //led = 0.5f; // shorthand for led.write() - //led.pulsewidth(2); // alternative to led.write, set duty cycle time in seconds - //while(1); + + // led1 = 1; + // led2 = 1; + + } \ No newline at end of file