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.
Test.cpp@1:fe268cc6317a, 2020-02-04 (annotated)
- Committer:
- thijskvm
- Date:
- Tue Feb 04 10:20:52 2020 +0000
- Revision:
- 1:fe268cc6317a
- Parent:
- 0:41beaa66228b
- Child:
- 2:adc2c3c165aa
1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| thomasvb02 | 0:41beaa66228b | 1 | #include "mbed.h" |
| thomasvb02 | 0:41beaa66228b | 2 | |
| thomasvb02 | 0:41beaa66228b | 3 | PwmOut Motor1 (A5); |
| thomasvb02 | 0:41beaa66228b | 4 | PwmOut Motor2 (A3); |
| thomasvb02 | 0:41beaa66228b | 5 | InteruptIn Sensor1 (A0,PullDown); |
| thomasvb02 | 0:41beaa66228b | 6 | InteruptIn Sensor2 (A1,PullDown); |
| thomasvb02 | 0:41beaa66228b | 7 | InteruptIn Sensor3 (A2,PullDown); |
| thomasvb02 | 0:41beaa66228b | 8 | InteruptIn Sensor4 (A6,PullDown); |
| thomasvb02 | 0:41beaa66228b | 9 | AnalogOut OVER (A4); |
| thomasvb02 | 0:41beaa66228b | 10 | DigitalOut LED (D8); |
| thomasvb02 | 0:41beaa66228b | 11 | DigitalOut Motor1Voor (D12); |
| thomasvb02 | 0:41beaa66228b | 12 | DigitalOut Motor1Achter (D11); |
| thomasvb02 | 0:41beaa66228b | 13 | DigitalOut Motor2Voor (D10); |
| thomasvb02 | 0:41beaa66228b | 14 | DigitalOut Motor2Achter (D9); |
| thijskvm | 1:fe268cc6317a | 15 | void vooruit() |
| thijskvm | 1:fe268cc6317a | 16 | { |
| thijskvm | 1:fe268cc6317a | 17 | Motor1Voor=1; |
| thijskvm | 1:fe268cc6317a | 18 | Motor1Achter=0; |
| thijskvm | 1:fe268cc6317a | 19 | Motor2Voor=1; |
| thijskvm | 1:fe268cc6317a | 20 | Motor2Achter=0; |
| thijskvm | 1:fe268cc6317a | 21 | Motor1=0.5; |
| thijskvm | 1:fe268cc6317a | 22 | Motor2=1; |
| thijskvm | 1:fe268cc6317a | 23 | } |
| thijskvm | 1:fe268cc6317a | 24 | void achteruit() |
| thijskvm | 1:fe268cc6317a | 25 | { |
| thijskvm | 1:fe268cc6317a | 26 | Motor1Voor=0; |
| thijskvm | 1:fe268cc6317a | 27 | Motor1Achter=1; |
| thijskvm | 1:fe268cc6317a | 28 | Motor2Voor=0; |
| thijskvm | 1:fe268cc6317a | 29 | Motor2Achter=1; |
| thijskvm | 1:fe268cc6317a | 30 | } |
| thijskvm | 1:fe268cc6317a | 31 | |
| thomasvb02 | 0:41beaa66228b | 32 | void Kijk() |
| thomasvb02 | 0:41beaa66228b | 33 | { |
| thomasvb02 | 0:41beaa66228b | 34 | if (Sensor1 = 0.5) { |
| thomasvb02 | 0:41beaa66228b | 35 | Motor |
| thomasvb02 | 0:41beaa66228b | 36 | int main() |
| thomasvb02 | 0:41beaa66228b | 37 | |
| thomasvb02 | 0:41beaa66228b | 38 | while(1) { |