Advertisement
ollikol

Week 4 assignments by group 11

Apr 8th, 2020
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. //Week 4 assignments by group 11
  2. #include <project.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include "FreeRTOS.h"
  6. #include "task.h"
  7. #include "Motor.h"
  8. #include "Ultra.h"
  9. #include "Nunchuk.h"
  10. #include "Reflectance.h"
  11. #include "Gyro.h"
  12. #include "Accel_magnet.h"
  13. #include "LSM303D.h"
  14. #include "IR.h"
  15. #include "Beep.h"
  16. #include "mqtt_sender.h"
  17. #include <time.h>
  18. #include <sys/time.h>
  19. #include "serial1.h"
  20. #include <unistd.h>
  21.  
  22. //Assignment 1 by Olli
  23. #if 1
  24. void zmain(void)
  25. {
  26.     IR_Start();
  27.     while(true)
  28.     {
  29.         vTaskDelay(100);
  30.         if(SW1_Read() == 0)
  31.         {
  32.             motor_start();
  33.             motor_forward(50,300);
  34.             motor_forward(0,0);
  35.             IR_wait();
  36.             printf("IR command received\n");
  37.             motor_forward(50,2350);
  38.             motor_stop();
  39.             while(true)
  40.             {
  41.                 vTaskDelay(100);
  42.             }
  43.         }
  44.     }
  45. }
  46. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement