//sound detection and display task SoundDB() { //Declare Variables int i; int soundLVL; SensorType[S1] = sensorSoundDBA; soundLVL = 0; displayInverseStringAt(5, 120, "Sound Level");//Display 'Sound Level' at top left of screen while(true){ soundLVL = SensorValue[S1]; if(soundLVL > 80) soundLVL = 80;//set max for Db reading //Draw Sound Bar for(i = 0; i < soundLVL; i++){ fillRect(0,0,30,NOISE + i); sleep(1); } //Erase Sound Bar for(i = soundLVL; i > 0; i--){ eraseRect(0,(NOISE + i)-1,30,NOISE + i); sleep(1); } }//end while true }//end soundDB
/*-----------------------------------------------------------------------------*/ void iqDisplayLine( int row, bool select, char *str ) { if( row < 0 || row > 43 ) return; if( select ) { fillRect( 0, row+1, 127, row-8); displayInverseStringAt( 1, row, str ); } else { eraseRect( 0, row+1, 127, row-8); displayStringAt( 1, row, str); } }