![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Testprogramm für BERTL 2014, der BULME Graz/Gösting. Der BERTL dreht sich für 1s, danach steht er für 1s
main.cpp@0:e93486305e5e, 2014-05-20 (annotated)
- Committer:
- bulme_rai
- Date:
- Tue May 20 07:02:24 2014 +0000
- Revision:
- 0:e93486305e5e
Testprogramm f?r BERTL 2014, der BULME Graz/G?sting.; Der BERTL dreht sich f?r 1s danach steht er f?r 1s
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bulme_rai | 0:e93486305e5e | 1 | /*********************************** |
bulme_rai | 0:e93486305e5e | 2 | name: BERTL_2014_MOTOR_1 |
bulme_rai | 0:e93486305e5e | 3 | author: Wolfgang Raimann |
bulme_rai | 0:e93486305e5e | 4 | email: rai@bulme.at |
bulme_rai | 0:e93486305e5e | 5 | description: |
bulme_rai | 0:e93486305e5e | 6 | Der Bertl dreht sich im Kreis für 1s danach steht er für 1s |
bulme_rai | 0:e93486305e5e | 7 | ***********************************/ |
bulme_rai | 0:e93486305e5e | 8 | |
bulme_rai | 0:e93486305e5e | 9 | #include "mbed.h" |
bulme_rai | 0:e93486305e5e | 10 | |
bulme_rai | 0:e93486305e5e | 11 | DigitalOut MotorL_EN(p34); |
bulme_rai | 0:e93486305e5e | 12 | DigitalOut MotorL_FORWARD(P1_0); |
bulme_rai | 0:e93486305e5e | 13 | DigitalOut MotorL_REVERSE(P1_1); |
bulme_rai | 0:e93486305e5e | 14 | |
bulme_rai | 0:e93486305e5e | 15 | DigitalOut MotorR_EN(p36); |
bulme_rai | 0:e93486305e5e | 16 | DigitalOut MotorR_FORWARD(P1_3); |
bulme_rai | 0:e93486305e5e | 17 | DigitalOut MotorR_REVERSE(P1_4); |
bulme_rai | 0:e93486305e5e | 18 | |
bulme_rai | 0:e93486305e5e | 19 | int main() { |
bulme_rai | 0:e93486305e5e | 20 | MotorL_FORWARD = MotorR_REVERSE = 1; |
bulme_rai | 0:e93486305e5e | 21 | while(1) { |
bulme_rai | 0:e93486305e5e | 22 | MotorL_EN = MotorR_EN = 1; |
bulme_rai | 0:e93486305e5e | 23 | wait(1); |
bulme_rai | 0:e93486305e5e | 24 | MotorL_EN = MotorR_EN = 0; |
bulme_rai | 0:e93486305e5e | 25 | wait(1); |
bulme_rai | 0:e93486305e5e | 26 | } |
bulme_rai | 0:e93486305e5e | 27 | } |