P2-4 - changes Note the removal of most of the device...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Spring 2007 Embedded Systems Programming Project 2-4 Showing progress 1. Download the redleds.c (Red LED arbitration) routine. Replace your current redleds.c content with this file. You will need to update the redleds.h file also. 2. Now create new modules progress.c and progress.h. Define a function called show_progress() that will alternately turn on then off red LEDs to simulate motion from right to left. The motion timing should be ¼ second. To change the LEDs, you will need to use the appropriate function from the new redleds device driver. 3. Following is a test routine (Your code MUST be callable by this routine with no
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: changes). Note the removal of most of the device driver #include’s. The top level code usually should not directly interact with the device drivers. /* file: p2_4.c */ #include <stdio.h> #include "alive.h" #include "progress.h" int main ( void ) { printf( "\n\rStarting p2_4.c (ESP N2 V2)\n\r" ); if ( sys_clock_init() != 0 ) { printf ( "No system clock available\n" ); return 4; } while (1) { // this is where we will eventually do some real work show_progress(); // make it look like we are working alive(); // show that we are still alive } return 0; } 4. The timing of your alive routine should not have changed....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online