- Conference Session
- Instrumentation Technical Session
- Collection
- 2013 ASEE Annual Conference & Exposition
- Authors
-
Mohammad Rafiq Muqri, DeVry University, Pomona; Robert Alfaro
- Tagged Divisions
-
Instrumentation
){ // displays hex integer as decimal to lcd int valcopy; // abbreviations: R. = remainder, Q. = quotient char dig[5] = {0}; // storage for R.'s int i = 0; // index into array called dig[ ] if(val == 0) lcd_putchar('0'); // statements below do nothing if val==0 if(val < 0){ val = ((~val)+1); // get hex magnitude if negative and... lcd_putchar('-'); // ...display minus sign in front } Page 23.263.13 valcopy = val; // successive /10 to generate R.'s while(val){ // keep looping until Q. drops to 0 val /= 10; // 1st Q., next Q., etc. dig[i++] = (char)(valcopy % 10); // 1st R., store it, next R.. etc. valcopy = val; // copy of