2023 Functional Requirements You are required to recreate one of the Arduino functions You must be | Assignment Collections
Computer Science 2023 Arduino Code/ Code+design Required
2023 Functional Requirements You are required to recreate one of the Arduino functions You must be | Assignment Collections
Functional Requirements
You are required to recreate one of the Arduino functions.
- You must be able to set an arbitrary delay (in milliseconds) using your own function, mimicking the behavior of delay().
- You must be able to turn on and off an LED attached to pin 13. Each second you must toggle the state of the LED.
Technical Requirements
This section will serve as a guideline of what is necessary for the program to behave correctly.
You need to implement the following functions:
- void delay_one_ms(): This function uses Timer0 to implement a one millisecond delay. Follow the steps below to get this function working properly:
- Choose a prescaler for the desired delay
- Disable the I-Flag in the SREG. Alternatively, save a copy of SREG to restore later.
- Set the proper value in TCNT0.
- Set Timer0 to Normal Mode.
- Set the prescaler bits.
- Wait until the overflow flag TOV0 is set.
- Stop the clock.
- Clear the TOV0 flag by setting it.
- Restore the interrupts by setting the I-Flag in the SREG. Or load SREG from the copy you made before.
void delay_one_ms(){
...
}
- void delay_generic(unsigned long ms): This function calls the delay_one_ms() function to implement a delay for an arbitrary amount of milliseconds. This function recreates the behavior of the Arduino delay() function.
void delay_generic(unsigned long ms){
...
// call delay_one_ms()
...
}
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.