SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.
Dependencies: TSI USBDevice mbed-dev
Fork of SmartWheels by
Hardwares/WheelEncoder.h@15:eb6a274b3dfb, 2017-02-14 (annotated)
- Committer:
- Bobymicjohn
- Date:
- Tue Feb 14 19:51:57 2017 +0000
- Revision:
- 15:eb6a274b3dfb
- Child:
- 65:295c222fdf88
Finished wheelEncoder class.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bobymicjohn | 15:eb6a274b3dfb | 1 | #pragma once |
Bobymicjohn | 15:eb6a274b3dfb | 2 | |
Bobymicjohn | 15:eb6a274b3dfb | 3 | #include <mbed.h> |
Bobymicjohn | 15:eb6a274b3dfb | 4 | |
Bobymicjohn | 15:eb6a274b3dfb | 5 | namespace SW |
Bobymicjohn | 15:eb6a274b3dfb | 6 | { |
Bobymicjohn | 15:eb6a274b3dfb | 7 | class Core; |
Bobymicjohn | 15:eb6a274b3dfb | 8 | } |
Bobymicjohn | 15:eb6a274b3dfb | 9 | |
Bobymicjohn | 15:eb6a274b3dfb | 10 | class WheelEncoder |
Bobymicjohn | 15:eb6a274b3dfb | 11 | { |
Bobymicjohn | 15:eb6a274b3dfb | 12 | public: |
Bobymicjohn | 15:eb6a274b3dfb | 13 | WheelEncoder(SW::Core &core); |
Bobymicjohn | 15:eb6a274b3dfb | 14 | |
Bobymicjohn | 15:eb6a274b3dfb | 15 | ~WheelEncoder(); |
Bobymicjohn | 15:eb6a274b3dfb | 16 | |
Bobymicjohn | 15:eb6a274b3dfb | 17 | void Update(float deltaTime); |
Bobymicjohn | 15:eb6a274b3dfb | 18 | |
Bobymicjohn | 15:eb6a274b3dfb | 19 | private: |
Bobymicjohn | 15:eb6a274b3dfb | 20 | |
Bobymicjohn | 15:eb6a274b3dfb | 21 | void pulseInRRight(); |
Bobymicjohn | 15:eb6a274b3dfb | 22 | |
Bobymicjohn | 15:eb6a274b3dfb | 23 | void pulseInRLeft(); |
Bobymicjohn | 15:eb6a274b3dfb | 24 | |
Bobymicjohn | 15:eb6a274b3dfb | 25 | SW::Core& m_core; |
Bobymicjohn | 15:eb6a274b3dfb | 26 | |
Bobymicjohn | 15:eb6a274b3dfb | 27 | InterruptIn m_intRL; |
Bobymicjohn | 15:eb6a274b3dfb | 28 | |
Bobymicjohn | 15:eb6a274b3dfb | 29 | InterruptIn m_intRR; |
Bobymicjohn | 15:eb6a274b3dfb | 30 | |
Bobymicjohn | 15:eb6a274b3dfb | 31 | Timer m_rrightTimer, m_rleftTimer; |
Bobymicjohn | 15:eb6a274b3dfb | 32 | |
Bobymicjohn | 15:eb6a274b3dfb | 33 | float m_rrDuration, m_rlDuration; |
Bobymicjohn | 15:eb6a274b3dfb | 34 | }; |