Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nodebug void Task3 (void *data)
- {
- /* Add a third Task to read ADC 1
- /* Clear the previour value inside the TOWER
- /* Normailize the [min, max] value of ADC [14 to 0]
- /* Dispaly the value Inside the TOWER
- /* Delay the task */
- auto UBYTE err;
- auto char display[64];
- int IRsensor;
- int scaled;
- for(;;){
- IRsensor = anaIn(1);
- sprintf(display, "%d", IRsensor);
- scaled = (float)((IRsensor - 1535) * 14 / 464);
- scaled = (scaled>14) ? 14 : (scaled < 0) ? 0 : scaled;
- DisplayTower();
- DispStr(61, (6+scaled), display);
- OSTimeDly(40);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement