Quiz+4-18

Quiz 4-18:

Now that you have yesterday's quiz matered, you can do the following: Give the code that would Read the Touch sensor into T and read the Sonar sensor into S.

Display the word "Touch on the 1st line of the NXT display Display the value of the touch sensor on the 2nd line Display the word Sonar on the 4th line of the NXT display Display the value of the sonar sensor on the 5thline

Put all this in a function called GetReadings.

Have a SuperDuperFabulousGreatandFantastic Day!

int T; int S;

void ShowSensors { T = SensorValue(Touch); S = SensorValue(Sonar); nxtDisplayCenteredBigTextLine(1,"Touch");  nxtDisplayCenteredBigTextLine(2,"%d",T); //Show value of Touch Sensor// nxtDisplayCenteredBigTextLine(4,"Sonar");  nxtDisplayCenteredBigTextLine(5,"%d",S); // Show the value of the Sonar Sensor  // }