Question
Using FreeRTOS build the following system: The system should consist of three tasks. Keypad Task When notified by an ISR that a key has been
Using FreeRTOS build the following system: The system should consist of three tasks.
Keypad Task
When notified by an ISR that a key has been pressed this task should scan the keypad to find out what key has been pressed. It should then pass on the ascii code of the key pressed to the Key Display Task.
Key Display Task
When keys are pressed on the keypad this task should display them on the LCD. Once the screen is full this task should clear the screen and continue displaying the next pressed keys from position 0 again. This process should happen continuously.
Temperature task
Using the provided ADC library this task should display the temperature on the LCD if it changes by more than 1 degree C. The LCD should be cleared before displaying the Temperature. The Temperature should remain on the screen for 2 seconds. The temperature sensor (lm35) should be polled every second.
Other Requirements:
The system should only react to a key press and not a release. After displaying the temperature the LCD should go back to the key press display it had before as if nothing had happened. If a key was pressed while the temperature was being displayed this should be captured and be on the display when the temperature finishes displaying.
HINT:
Investigate the use of an RTOS queue to send the key ascii code from the Keypad Task to the Key Display Task.
/// The ADC libraries
/*adc.h*/
#ifndef ADC_H_ #define ADC_H_ void adcInit(uint8_t channel); uint16_t adcRead(void); #endif /* ADC_H_ */
/*adc.c*/
#includevoid adcInit(uint8_t channel){ //Make the channel an input pin DDRC &= ~(1 << channel); //Connect channel to ADC ADMUX |= channel; //use AVcc as ref voltage ADMUX |= (1 << REFS0); //128 prescale = 125kHz ADC clock ADCSRA |= ((1 << ADPS0) | (1 << ADPS1) | (1 << ADPS2)); //switch on ADC ADCSRA |= (1< I know this is impossible to do without having the circuit and arduino. But at least give me something so I can finish it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started