////////////////////////////////////////////////////////////// // Description: // // Simple C main program for Lab 10b ////////////////////////////////////////////////////////////// // 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; } }