An open API service indexing awesome lists of open source software.

https://github.com/boomerwing/freertos-trafficlight

FreeRTOS simulation of a Traffic Light
https://github.com/boomerwing/freertos-trafficlight

7seg c freertos pcf-8575-gpio-extender pico rp2040 simulation switch-debounce traffic-light

Last synced: 13 days ago
JSON representation

FreeRTOS simulation of a Traffic Light

Awesome Lists containing this project

README

          

# FreeRTOS-TrafficLight
FreeRTOS simulation of a Traffic Light

This Raspberry Pi Pico code exercise simulates a North-South and East-West intersection Traffic Light.
The light switches through the GREEN YELLOW RED sequence with a pause where both
directions show RED for a short pause as a safety measure.

As well, a switch is included to forcefully provide a blinking RED in both directions. This
blinking RED is active after the YELLOW to allow the traffic to stop co-operatively (Not
commanding one direction to stop directly from a GREEN state).

The code includes a Switch Debounce Task which provides for many combinations of switches to
be used. The task leaves detected switch changes in a Queue where another interested task can
check to see the switch state. Any switch combinations and Queues you do not need can be removed to
reduce the size of the code.

The I/O is implemented through a PCF8575 i2s port extender driving a seven segment LED on my
experimental breadboard, although any six LEDs would work.