dit is em
Dependencies: mbed
Diff: main.cpp
- Revision:
- 8:ec7b7c9ad07e
- Parent:
- 7:ed076babd381
- Child:
- 10:18116d979d61
--- a/main.cpp Fri Mar 03 08:05:32 2017 +0000 +++ b/main.cpp Fri Mar 03 09:39:28 2017 +0000 @@ -12,9 +12,22 @@ + int main() { while(1) { - if ( Sensor1 >= 100) { + if ( Sensor1 >= 1) { + Motor1 = 0 ; + Motor2 = 1 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (500); + Motor1 = 1 ; + Motor2 = 0 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (1000); + } + if (Sensor2 >= 1) { Motor1 = 0 ; Motor2 = 1 ; Motor3 = 0 ; @@ -26,7 +39,30 @@ Motor4 = 1 ; wait_ms (1000); } - + if (Sensor3 >= 1) { + Motor1 = 0 ; + Motor2 = 1 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (500); + Motor1 = 1 ; + Motor2 = 0 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (1000); + } + if (Sensor4 >= 1) { + Motor1 = 0 ; + Motor2 = 1 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (500); + Motor1 = 1 ; + Motor2 = 0 ; + Motor3 = 0 ; + Motor4 = 1 ; + wait_ms (1000); + } else { Motor1 = 1 ; Motor2 = 0 ;