Makoto Kobayashi
/
test_volume
volume test
main.cpp@0:aafad4013d38, 2014-10-20 (annotated)
- Committer:
- neoqased
- Date:
- Mon Oct 20 11:11:27 2014 +0000
- Revision:
- 0:aafad4013d38
aaa
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
neoqased | 0:aafad4013d38 | 1 | #include "mbed.h" |
neoqased | 0:aafad4013d38 | 2 | |
neoqased | 0:aafad4013d38 | 3 | PwmOut myled(LED1); |
neoqased | 0:aafad4013d38 | 4 | AnalogIn volume(p20); |
neoqased | 0:aafad4013d38 | 5 | |
neoqased | 0:aafad4013d38 | 6 | int main(){ |
neoqased | 0:aafad4013d38 | 7 | float vol = 0; |
neoqased | 0:aafad4013d38 | 8 | myled.period_us(100); |
neoqased | 0:aafad4013d38 | 9 | while(1){ |
neoqased | 0:aafad4013d38 | 10 | vol = 1 - volume; |
neoqased | 0:aafad4013d38 | 11 | myled = vol; |
neoqased | 0:aafad4013d38 | 12 | wait_ms(50); |
neoqased | 0:aafad4013d38 | 13 | } |
neoqased | 0:aafad4013d38 | 14 | } |