Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. --1G 2A 4R
  2. loop
  3. --if button pressed
  4. if Pedestrian_Button(North) = 1 then
  5. --Pedestrian wait light on
  6. Pedestrian_Wait(North) :=1;
  7. Pedestrian_Wait(South) :=1;
  8. Pedestrian_Wait(East) :=1;
  9. Pedestrian_Wait(West) :=1;
  10. --Red & Amber
  11. Traffic_Light(North) := 6;
  12. Traffic_Light(South) := 6;
  13. delay 2.0;
  14. --Green
  15. Traffic_Light(North) := 1;
  16. Traffic_Light(South) := 1;
  17. delay 5.0;
  18. --Amber
  19. Traffic_Light(North) := 2;
  20. Traffic_Light(South) := 2;
  21. delay 3.0;
  22. --Red
  23. Traffic_Light(North) := 4;
  24. Traffic_Light(South) := 4;
  25. delay 2.0;
  26. --Predestrian wait light off
  27. Pedestrian_Wait(North) :=0;
  28. Pedestrian_Wait(South) :=0;
  29. Pedestrian_Wait(East) :=0;
  30. Pedestrian_Wait(West) :=0;
  31. --Pedestrian green light
  32. Pedestrian_Light(North) :=1;
  33. Pedestrian_Light(South) :=1;
  34. Pedestrian_Light(East) :=1;
  35. Pedestrian_Light(West) :=1;
  36. delay 6.0;
  37. --Pedestrian red light
  38. Pedestrian_Light(North) :=2;
  39. Pedestrian_Light(South) :=2;
  40. Pedestrian_Light(East) :=2;
  41. Pedestrian_Light(West) :=2;
  42. delay 2.0;
  43.  
  44. Traffic_Light(East) := 6;
  45. Traffic_Light(West) := 6;
  46. delay 2.0;
  47. Traffic_Light(East) := 1;
  48. Traffic_Light(West) := 1;
  49. delay 5.0;
  50.  
  51. Traffic_Light(East) := 2;
  52. Traffic_Light(West) := 2;
  53. delay 3.0;
  54.  
  55. Traffic_Light(East) := 4;
  56. Traffic_Light(West) := 4;
  57. delay 2.0;
  58.  
  59. end if;
  60. Traffic_Light(North) := 6;
  61. Traffic_Light(South) := 6;
  62. delay 2.0;
  63. Traffic_Light(North) := 1;
  64. Traffic_Light(South) := 1;
  65. delay 5.0;
  66. Traffic_Light(North) := 2;
  67. Traffic_Light(South) := 2;
  68. delay 3.0;
  69. Traffic_Light(North) := 4;
  70. Traffic_Light(South) := 4;
  71. delay 2.0;
  72.  
  73. Traffic_Light(East) := 6;
  74. Traffic_Light(West) := 6;
  75. delay 2.0;
  76. Traffic_Light(East) := 1;
  77. Traffic_Light(West) := 1;
  78. delay 5.0;
  79.  
  80. Traffic_Light(East) := 2;
  81. Traffic_Light(West) := 2;
  82. delay 3.0;
  83.  
  84. Traffic_Light(East) := 4;
  85. Traffic_Light(West) := 4;
  86. delay 2.0;
  87.  
  88.  
  89. end loop;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement