Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo mbed-rtos mbed
engine.hpp@2:7dfc8dd6aab3, 2015-10-08 (annotated)
- Committer:
- mariob
- Date:
- Thu Oct 08 13:36:17 2015 +0000
- Revision:
- 2:7dfc8dd6aab3
- Parent:
- 1:79b1ee0f97ef
added body implementation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mariob | 1:79b1ee0f97ef | 1 | #ifndef __ENGINE_HPP__ |
mariob | 1:79b1ee0f97ef | 2 | #define __ENGINE_HPP__ |
mariob | 1:79b1ee0f97ef | 3 | |
mariob | 2:7dfc8dd6aab3 | 4 | /** |
mariob | 2:7dfc8dd6aab3 | 5 | * Initialization of the engine component: |
mariob | 2:7dfc8dd6aab3 | 6 | * - main engine |
mariob | 2:7dfc8dd6aab3 | 7 | * - steering motor |
mariob | 2:7dfc8dd6aab3 | 8 | */ |
mariob | 1:79b1ee0f97ef | 9 | void init_engine(); |
mariob | 1:79b1ee0f97ef | 10 | |
mariob | 2:7dfc8dd6aab3 | 11 | /** |
mariob | 2:7dfc8dd6aab3 | 12 | * The thread executes periodically: |
mariob | 2:7dfc8dd6aab3 | 13 | * - check inputs: if no message has arrived for 2.5 seconds, switch the |
mariob | 2:7dfc8dd6aab3 | 14 | * actuators off |
mariob | 2:7dfc8dd6aab3 | 15 | * - actuation: |
mariob | 2:7dfc8dd6aab3 | 16 | * - rotate steering servo motor |
mariob | 2:7dfc8dd6aab3 | 17 | * - main engine: |
mariob | 2:7dfc8dd6aab3 | 18 | * - if the driver is breaking, block the motor for no more than 1 seconds |
mariob | 2:7dfc8dd6aab3 | 19 | * (while breaking the engine dissipates much power) |
mariob | 2:7dfc8dd6aab3 | 20 | * - otherwise, set direction and set the current which flows into the |
mariob | 2:7dfc8dd6aab3 | 21 | * motor |
mariob | 2:7dfc8dd6aab3 | 22 | */ |
mariob | 1:79b1ee0f97ef | 23 | void thread_engine (void const *args); |
mariob | 1:79b1ee0f97ef | 24 | |
mariob | 1:79b1ee0f97ef | 25 | #endif //__ENGINE_HPP__ |