Using an MSP430 modify the source code provided to complete the following: A. Wr
ID: 3850942 • Letter: U
Question
Using an MSP430 modify the source code provided to complete the following:
A. Write a function named sec_hundredths_delay() that will take one argument that specifies a delay in hundredths of a second. B. Modify your software to continually read a user-input five-bit number to be used as time in hundredths of a second to turn on the output LED calling sec_hundredths_delay(). Every time the LED is on, it must then go off for 200 ms. C. Test your implementation turning on the LED for 50 ms, 500 ms, and 3 seconds.
MSP430F22x4 Demo Software Toggle 1.0 Description Toggle P1.0 by xor ing P1.0 inside of a software loop ACLK n/a MCLK. J SMCLK default DCO 1.2MHz MSP430 22x4 /INI XIN XOUT I RST P1.0 I-- LED A. Dannenberg Texas Instruments Inc. April 2006 Built with CCE version 3.2.0 and IAR Embedded Workbench Version: 3.41A #includeExplanation / Answer
a.
c.
void setup() {
pinMode(50ms, OUTPUT);
pinMode(500ms, OUTPUT);
pinMode(3000ms, OUTPUT);
}
void loop() {
digitalWrite(50ms, HIGH);
for (int x=0; x < 1000; x++) {
delay(1);
}
digitalWrite(500ms, HIGH);
for (int x=0; x < 1000; x++)
{
delay(1);
}
digitalWrite(3000ms, HIGH);
for (int x=0; x < 3000; x++)
{
delay(1);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.