ryan lin
/
wheeldriveassistance
wheelchair code for driver assitance
Fork of wheelchairalexa by
Diff: wheelchair.cpp
- Revision:
- 1:c0beadca1617
- Parent:
- 0:fc0c4a184482
- Child:
- 3:a5e71bfdb492
--- a/wheelchair.cpp Thu Jul 12 18:36:09 2018 +0000 +++ b/wheelchair.cpp Thu Jul 12 19:06:33 2018 +0000 @@ -1,34 +1,41 @@ #include "wheelchair.h" -/* -Wheelchair::Wheelchair(PinName xPin, PinName yPin){ - x = new AnalogOut(xPin); - y = new AnalogOut(yPin); - } + +Wheelchair::Wheelchair(PinName xPin, PinName yPin) +{ + x = new AnalogOut(xPin); + y = new AnalogOut(yPin); +} -void Wheelchair::move(float degrees){ - } - -void Wheelchair::forward(){ +void Wheelchair::move(float degrees) +{ +} + +void Wheelchair::forward() +{ x->write(high); y->write(def); } -void Wheelchair::backward(){ +void Wheelchair::backward() +{ x->write(low); y->write(def); } -void Wheelchair::right(){ +void Wheelchair::right() +{ x->write(def); y->write(high); } -void Wheelchair::left(){ +void Wheelchair::left() +{ x->write(def); y->write(low); } -void Wheelchair::stop(){ +void Wheelchair::stop() +{ x->write(def); y->write(def); -}*/ \ No newline at end of file +} \ No newline at end of file