Availability | OPN-6000 |
Description |
This function controls the vibrating motor. The vibrations will be felt by the person
holding the terminal and can be used as an indicator in a noisy environment where the
buzzer - controlled by the Sound() function - is
not loud enough. This function is available only on special versions of some terminals that have the vibrating motor option installed. |
Syntax | void Vibrate( int time ); |
Arguments |
int timeDefines the time the vibrating motor is on, in steps of 20 milliseconds. After this time the vibrating motor will be switched off. For example, time = 25 specifies half a second. time = 0 will stop the vibrating motor immediately. |
Returns | None |
Remarks |
Because the handling of the vibrating motor is done by the operating system,
the terminal will continue executing the application program during the time the
vibrating motor is on. After the 'on-time' period has elapsed, the execution is
interrupted in order to switch off the vibrating motor. Use the Delay() function if you want to halt program execution until the vibrating motor is switched off again. Vibrate() is available only on special versions of some terminals that have the vibrating motor option installed. |
Example |
// This program reads and displays a barcode. After each successful barcode reading, // it gives a good read signal on the LED, a buzzer signal and vibrates. // // Note that an extra check is made on the minimum length when the barcode symbology // is one of the 2 of 5 codes, or Codabar. This is done because of the poor // specifications of these symbologies. // Note the use of a loop, repeatedly invoking ReadBarcode(). #include <stdio.h> #include "lib.h" void main( void ) { char bcr_buf[42]; struct barcode code; code.min = 1; code.max = 41; code.text = bcr_buf; ScannerPower(TRIGGER | SINGLE, 250); // Trigger mode, 5 seconds read time, scanner off after 1 barcode for(;;) { if( ReadBarcode( &code ) == OK) { GoodReadLed(GREEN, 10); Sound(TSTANDARD, VHIGH, SMEDIUM, SHIGH, 0); Vibrate(TSTANDARD); printf("%*s\r", code.length, code.text); } Idle(); } } |