elevator
/
elevator_lab
calibration code
main.cpp@0:fa52d9ab56ee, 2015-02-19 (annotated)
- Committer:
- Ty
- Date:
- Thu Feb 19 14:29:52 2015 +0000
- Revision:
- 0:fa52d9ab56ee
here it is
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ty | 0:fa52d9ab56ee | 1 | #include "mbed.h" |
Ty | 0:fa52d9ab56ee | 2 | #include "Motor.h" |
Ty | 0:fa52d9ab56ee | 3 | Serial pc(USBTX,USBRX);//allows communication through the USB |
Ty | 0:fa52d9ab56ee | 4 | AnalogIn range(p19); |
Ty | 0:fa52d9ab56ee | 5 | Motor m(p26, p29, p30); |
Ty | 0:fa52d9ab56ee | 6 | float rv; |
Ty | 0:fa52d9ab56ee | 7 | int main() |
Ty | 0:fa52d9ab56ee | 8 | { |
Ty | 0:fa52d9ab56ee | 9 | m.speed(0); |
Ty | 0:fa52d9ab56ee | 10 | pc.baud(9600); |
Ty | 0:fa52d9ab56ee | 11 | pc.format(7,SerialBase::None,1); |
Ty | 0:fa52d9ab56ee | 12 | while(1) { |
Ty | 0:fa52d9ab56ee | 13 | rv=range; |
Ty | 0:fa52d9ab56ee | 14 | pc.printf("%f\n",rv); |
Ty | 0:fa52d9ab56ee | 15 | |
Ty | 0:fa52d9ab56ee | 16 | } |
Ty | 0:fa52d9ab56ee | 17 | } |