C Language Development Kit/Functions/GoodReadLed
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/Goodreadled)
| Description | This function controls the good read LED. | ||||||||||||||||||||||||||||||||
| Syntax | void goodreadled(int on_off, int time); | ||||||||||||||||||||||||||||||||
| Arguments | This parameter can have the following values:
int on_off
Defines the time the LED is on in steps of 20 milliseconds. After this time the LED will be switched off. For examples, time = 25 specifies half a second. Two values have a special meaning.
int time
| ||||||||||||||||||||||||||||||||
| Returns | None | ||||||||||||||||||||||||||||||||
| Remarks | Because the handling of the good read LED is done by the operating system,
the terminal will continue executing the application program, during the time the LED is on. After the 'on-time' period has elapsed, the execution is interrupted in order to switch off the LED. Use the delay() function if you want to halt program execution until the good read LED is switched off again. | ||||||||||||||||||||||||||||||||
| Example | #include "lib.h" #include <stdio.h> void main( void ) { int x; while( 1 ) { for( x=0; x < 10; x++) { goodreadled( RED, 25); delay( 50 ); goodreadled( GREEN, 25); delay( 50 ); #ifdef BLUE goodreadled( BLUE, 25); delay( 50 ); #endif } goodreadled( RED, -1); delay( 200 ); goodreadled( RED, 0); goodreadled( GREEN, -1); delay( 200 ); goodreadled( GREEN, 0); #ifdef BLUE goodreadled( BLUE, -1); delay( 200 ); goodreadled( BLUE, 0); #endif } } |
