FatFingerShell vt with fullscreen keyboard
Aapo Rantalainen
aapo.rantalainen at gmail.com
Fri Mar 27 12:16:50 CET 2009
How about vibration feedback? Because I do not want use sound-feedback
in bus/train. And maybe somebody else can't use visual-feedback for
some reason. So there could be three different (selectable) feedback.
I have used this little snip to do some vibration (Its for c++, but
you got the point):
//Vibrarion
#include <pthread.h> //thread
#include <fstream> //file handling
#include <iostream> //file handling
#include <unistd.h> //sleep
using namespace std;
void *vibration(void *arg)
{
char power[5]="100\n";
int duration = 300; /* in milliseconds */
char FileName[44]="/sys/class/leds/neo1973:vibrator/brightness";
ofstream file_handle(FileName, ios::out);
file_handle << power ;
file_handle.flush();
usleep(duration *1000);
file_handle << "0\n" ;
file_handle.close();
return NULL;
}
and somewhere else
//Do some vibration
pthread_t pth; /*thread*/
pthread_create(&pth,NULL,vibration,NULL);
-Aapo Rantalainen
More information about the devel
mailing list