Thijs KVM / Mbed 2 deprecated DriveXchange

Dependencies:   mbed

Committer:
thijskvm
Date:
Tue Feb 04 10:22:37 2020 +0000
Revision:
2:adc2c3c165aa
Parent:
1:fe268cc6317a
Child:
3:a32882369c69
hoi;

Who changed what in which revision?

UserRevisionLine numberNew 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);
thijskvm 2:adc2c3c165aa 9 Interupt
thomasvb02 0:41beaa66228b 10 AnalogOut OVER (A4);
thomasvb02 0:41beaa66228b 11 DigitalOut LED (D8);
thomasvb02 0:41beaa66228b 12 DigitalOut Motor1Voor (D12);
thomasvb02 0:41beaa66228b 13 DigitalOut Motor1Achter (D11);
thomasvb02 0:41beaa66228b 14 DigitalOut Motor2Voor (D10);
thomasvb02 0:41beaa66228b 15 DigitalOut Motor2Achter (D9);
thijskvm 1:fe268cc6317a 16 void vooruit()
thijskvm 1:fe268cc6317a 17 {
thijskvm 1:fe268cc6317a 18 Motor1Voor=1;
thijskvm 1:fe268cc6317a 19 Motor1Achter=0;
thijskvm 1:fe268cc6317a 20 Motor2Voor=1;
thijskvm 1:fe268cc6317a 21 Motor2Achter=0;
thijskvm 1:fe268cc6317a 22 Motor1=0.5;
thijskvm 1:fe268cc6317a 23 Motor2=1;
thijskvm 1:fe268cc6317a 24 }
thijskvm 1:fe268cc6317a 25 void achteruit()
thijskvm 1:fe268cc6317a 26 {
thijskvm 1:fe268cc6317a 27 Motor1Voor=0;
thijskvm 1:fe268cc6317a 28 Motor1Achter=1;
thijskvm 1:fe268cc6317a 29 Motor2Voor=0;
thijskvm 1:fe268cc6317a 30 Motor2Achter=1;
thijskvm 1:fe268cc6317a 31 }
thijskvm 1:fe268cc6317a 32
thomasvb02 0:41beaa66228b 33 void Kijk()
thomasvb02 0:41beaa66228b 34 {
thomasvb02 0:41beaa66228b 35 if (Sensor1 = 0.5) {
thomasvb02 0:41beaa66228b 36 Motor
thomasvb02 0:41beaa66228b 37 int main()
thomasvb02 0:41beaa66228b 38
thomasvb02 0:41beaa66228b 39 while(1) {