FTKL USER
/
app-board-AnalogOut
TINF
main.cpp@5:1539103730cd, 2019-11-17 (annotated)
- Committer:
- ftkl_user
- Date:
- Sun Nov 17 07:40:26 2019 +0000
- Revision:
- 5:1539103730cd
- Parent:
- 4:922cae216520
- Child:
- 6:e46770317c24
printf error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:1a38bf78f122 | 1 | #include "mbed.h" |
chris | 0:1a38bf78f122 | 2 | |
chris | 0:1a38bf78f122 | 3 | AnalogOut Aout(p18); |
chris | 1:754db1ff50f2 | 4 | AnalogIn pot1(p19); |
chris | 0:1a38bf78f122 | 5 | |
chris | 0:1a38bf78f122 | 6 | int main() |
chris | 0:1a38bf78f122 | 7 | { |
ftkl_user | 2:acb0ba8a1395 | 8 | while(1) { |
chris | 0:1a38bf78f122 | 9 | for(float i=0.0; i<1.0; i+=0.1) { |
chris | 0:1a38bf78f122 | 10 | Aout = i; |
chris | 0:1a38bf78f122 | 11 | wait(0.00001+(0.0001*pot1.read())); |
ftkl_user | 5:1539103730cd | 12 | printf("%f\n", i; |
chris | 0:1a38bf78f122 | 13 | } |
chris | 0:1a38bf78f122 | 14 | } |
chris | 0:1a38bf78f122 | 15 | } |