DK
daniel koop

Traffic Light Controller - Copy this React, Tailwind Component to your project

In this lab, we will design a simple state machine that imitates a traffic light. The state machine should do the following: 1. Start in the “green” state. 2. Once switch S1 is pressed (or switched) the state machine should transition to the “yellow” state for 1 clock cycle. 3. After 1 clock cycle, the state machine should transition to the “red” state and stay there until switch S1 is pressed (or switched). 4. From the “red” state, after S1 is pressed, the state should transition to the “green” state.

Prompt
Component Preview

About

TrafficLightController - Simulate a traffic light with state transitions: green, yellow, red, and user interaction. Built with React a. View and copy code!

Share

Last updated 1 month ago