Yi Lin Chen
/
Boboobooo
shared
Fork of Boboobooo by
pot.cpp@8:089b778962c4, 2014-10-31 (annotated)
- Committer:
- Kruskal
- Date:
- Fri Oct 31 10:54:51 2014 +0000
- Revision:
- 8:089b778962c4
:D
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kruskal | 8:089b778962c4 | 1 | |
Kruskal | 8:089b778962c4 | 2 | #include "mbed.h" |
Kruskal | 8:089b778962c4 | 3 | #include "pot.h" |
Kruskal | 8:089b778962c4 | 4 | |
Kruskal | 8:089b778962c4 | 5 | |
Kruskal | 8:089b778962c4 | 6 | |
Kruskal | 8:089b778962c4 | 7 | BX_pot::BX_pot(char t){ |
Kruskal | 8:089b778962c4 | 8 | |
Kruskal | 8:089b778962c4 | 9 | |
Kruskal | 8:089b778962c4 | 10 | switch (t){ |
Kruskal | 8:089b778962c4 | 11 | case '1': |
Kruskal | 8:089b778962c4 | 12 | pot_in = new AnalogIn (PTB3); |
Kruskal | 8:089b778962c4 | 13 | break; |
Kruskal | 8:089b778962c4 | 14 | case '2': |
Kruskal | 8:089b778962c4 | 15 | pot_in = new AnalogIn (PTB2); |
Kruskal | 8:089b778962c4 | 16 | break; |
Kruskal | 8:089b778962c4 | 17 | } |
Kruskal | 8:089b778962c4 | 18 | |
Kruskal | 8:089b778962c4 | 19 | |
Kruskal | 8:089b778962c4 | 20 | |
Kruskal | 8:089b778962c4 | 21 | } |
Kruskal | 8:089b778962c4 | 22 | |
Kruskal | 8:089b778962c4 | 23 | float BX_pot::read(void){ |
Kruskal | 8:089b778962c4 | 24 | |
Kruskal | 8:089b778962c4 | 25 | |
Kruskal | 8:089b778962c4 | 26 | |
Kruskal | 8:089b778962c4 | 27 | return pot_in->read(); |
Kruskal | 8:089b778962c4 | 28 | |
Kruskal | 8:089b778962c4 | 29 | |
Kruskal | 8:089b778962c4 | 30 | } |