Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please modify the code to match the program? 0. Go to mbed site and log in using credentials created in previous labs. 1.

Can you please modify the code to match the program?

image text in transcribed
0. Go to mbed site and log in using credentials created in previous labs. 1. Duplicate previous project 2. Modify the code to match the following program: include "mbed. h' include "BufferedSerial.h" include "Watchdog.h" #include define WAIT TIME MS 3000 DigitalOut led (LED1) ; 9 DigitalOut a (PA_6) ; 10 BufferedSerial serial_port (USBTX, USBRX, 9600) ; Ticker timers interrupt; 12 void init function (void) 13 // global variables 14 int led state = 2; timers_interrupt. attach (atimers, 100ma) ; 15 t. set baud(960 int old_led_state = 0 serial port. set bi 16 int timerl = 0; serial port.set_format ( 17 /* bits */ void control_led () 18 88 char line [50] ; /* parity ./ Bufferedserial: : None, /' stop bit ./ if (led_state == 0) 19 char buf [50] = (0); 90 led = 0; 20 char c; sprintf (line, "Press '0' to turn LEDI ON\\") ; 21 void init_function (void) ; serial port. write (line, 27) ; 92 if (led_state == 1) led = 1; 22 void control function (void) ; 53 sprintf (line, "Press turn LED OFF\\") ; 93 23 serial port.write (line, 27 else if (led_state == 2) void receive_commands (void) ; sprintf (line, "Pre "to blink LED \ ") 24 void control_led (void) ; 56 serial port. write (line, 27) ; 95 sprintf (line, "Pre o sleep/blink \ ") ; 96 flash_led () ; 25 void flash_led (void) ; serial_port.write (line, 2!) 97 else if (led_state == 3 26 void flash_led_sleeper (void) ; 58 // Configure the watchdog timer with a 5-second timeout 98 27 void send_status (void) ; Watchdog: :get_instance () . start (200 99 flash_led_sleeper () : 28 void timers (void) ; 29 void pet_dog (void) ; 101 id control_function (void) 30 102 void flash_led () 31 int main (void) 64 commands () : receive_com if (timerl

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions