Kazuki Fujita
/
mbed_test_board
LPC11U35用テストプログラム
Revision 0:227de563fbb6, committed 2018-08-08
- Comitter:
- 771_8bit
- Date:
- Wed Aug 08 08:37:08 2018 +0000
- Commit message:
- LPC11U35????????
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 227de563fbb6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 08 08:37:08 2018 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +DigitalOut leds[] = { + DigitalOut( P0_19 ), + DigitalOut( P0_18 ), + DigitalOut( P0_17 ) +}; +DigitalIn sws[] = { + DigitalIn( P0_14 ), + DigitalIn( P0_15 ), + DigitalIn( P0_16 ) +}; +BusOut ledBus( P0_21, P0_3, P0_2, P0_20,P1_19 ); +AnalogIn adc(P0_23); +int a =0; +int main() +{ + + for(int i = 0; i <3; i++){ + sws[i].mode(PullUp); + } + + while(1) { + ledBus = int(adc.read()*16); + for(int i = 0; i <3; i++){ + leds[i] = !sws[i]; + } + }/* + while(1) { + ledBus = 0b10101; + wait(2); + for(int i = 0; i <32; i++) { + ledBus = i; + wait_us(i*20); + } + }*/ +} \ No newline at end of file
diff -r 000000000000 -r 227de563fbb6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Aug 08 08:37:08 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file