- 14 You Are Asked To Develop A Software Module To Control The Seatbelt Warning Lamp As Part Of A Car Dashboard For The 1 (119.6 KiB) Viewed 32 times
14) You are asked to develop a software module to control the seatbelt warning lamp as part of a car dashboard. For the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
14) You are asked to develop a software module to control the seatbelt warning lamp as part of a car dashboard. For the
14) You are asked to develop a software module to control the seatbelt warning lamp as part of a car dashboard. For the part of the system that you are responsible for, the following inputs and outputs are relevant: • Ports PB5...PB2 are connected to a RPM sensor that reports the current engine speed as a scaled (in units/increments of 500 RPM) unsigned 4-bit integer value, i.e. if the sensor reports a value of 2 on PB5...PB2, the engine speed is 1000 RPM. • Port PB0 is connected to the seatbelt switch that indicates whether the seatbelt is fastened. Port PB7 is connected to the safety warning indicator LED. Your subsystem is supposed to turn on the LED if the engine is running (RPM >= 1000) and the seatbelt is not fastened. Write a C program that performs a loop over and over to turn the LED on iff (if and only if) • the engine is running (RPM >= 1000), and the seatbelt is not fastened. In all other cases, the LED should be off. Do not modify unrelated bits of ports.