// main.c : Main C source file for Cpr E 211 labs ////////////////////////////////////////////////////////////// // Authors: Lab member 1 lab1@iastate.edu // Lab member 2 lab2@iastate.edu // // Lab: 7-9 AM, Monday // // TA: Cpr E 211 TA // // Instructor: Cpr E 211 Instructor // ////////////////////////////////////////////////////////////// // Description: // // Simple C main program for Lab 6 ////////////////////////////////////////////////////////////// // Include Files ////////////////////////////////////////////////////////////// #include "QTerm.h" // Accessing the QTerm-J10 Terminal #include "serial.h" // Accessing the serial ports #include "PPC_Support.h" // msleep & miscellaneous functions #include "defines.h" void Do_Tasks (); main () { Do_Tasks(); return 0; } void Do_Tasks () { char * pDIPSwitch1; char * pDIPSwitch2; char * p7Seg; char byVal; int j; pDIPSwitch1 = (char *) IO_DIGITAL_INPUT_DIP_1; pDIPSwitch2 = (char *) IO_DIGITAL_INPUT_DIP_2; p7Seg = (char *) IO_DIGITAL_OUTPUT_7SEG; /* Read the value from the first DIP switch & write it to the 7-segment display */ byVal = *pDIPSwitch1; *p7Seg = byVal; /* Read the value from the second DIP switch and increment it by the value of Switch 1 */ byVal = *pDIPSwitch2; for(j=0; j<*pDIPSwitch1; j++) { byVal += 1; } }