summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-08-24 23:42:32 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-08-24 23:42:32 +0200
commitbc90dfb83866078bce80034d06607b0094aa63e4 (patch)
treea66840c28f58720944cc711a82d426c9afe2490b /main.c
parent9bebf5f393bbfd51489b4c4e65a066e47e623f1e (diff)
downloadTraffic-light-bc90dfb83866078bce80034d06607b0094aa63e4.tar.xz
Traffic-light-bc90dfb83866078bce80034d06607b0094aa63e4.zip
Added the functionality of timers And finished the project
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/main.c b/main.c
index 1da8860..afbcce7 100644
--- a/main.c
+++ b/main.c
@@ -2,17 +2,23 @@
uint32_t period_1 = RED_PERIOD;
uint32_t period_2 = GREEN_PERIOD;
-uint32_t period_3 = RED_PERIOD;
+uint32_t period_3 = GREEN_PERIOD;
bool switch_pressed = false;
+//Traffics
+Traffic tf1 = {RED , GPIO_PORTA_BASE, 2, 3, 4};
+Traffic tf2 = {YELLOW, GPIO_PORTF_BASE, 1, 2, 3};
+Traffic tf_ped = {RED , GPIO_PORTB_BASE, 5, 0, 7};
-Traffic tf1 = {YELLOW, GPIO_PORTA_BASE, 2, 3, 4};
-Traffic tf2 = {RED , GPIO_PORTF_BASE, 1, 2, 3};
-Traffic tf_ped = {RED , GPIO_PORTB_BASE, 5, 4, 1};
+//Decoders
+Bcd bcd1 = {GPIO_PORTE_BASE, 1, 2, 3, 5};
+Bcd bcd2 = {GPIO_PORTD_BASE, 1, 2, 3, 6};
+Bcd bcd_ped = {GPIO_PORTA_BASE, 5, 6, 7, 4}; // (5, 6, 7) A and 4 of E
int main()
{
TrafficInit();
- // PortInit(GPIO_PORTA_BASE, SYSCTL_PERIPH_GPIOA, 0x0, 0xFF); // Initialize porta
- // GPIOPinWrite(GPIO_PORTA_BASE, 0xFF, 2);
+ // PortInit(GPIO_PORTE_BASE, SYSCTL_PERIPH_GPIOE, 0x0, 0xFF); // Initialize porta
+ // GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, 0);
+ // GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, (1 << 1) | (1 << 2));
}