KetaiVibrate
in
Android Processing
•
2 months ago
Hi, hopefully a quick question.
I'm trying to get a on/off vibrating alert using the Ketai library. I know it should be something along the lines of
This is my code
import ketai.ui.*;
KetaiVibrate vibe;
color backgroundcolor = color(0, 0, 0);
void setup()
{
orientation(LANDSCAPE);
textSize(28);
textAlign(CENTER);
vibe = new KetaiVibrate(this);
long[] pattern = {500, 300};
}
void draw()
{
background(backgroundcolor);
}
void mousePressed()
{
vibe.vibrate(pattern, -1);
}
void drawUI()
{
pushStyle();
textAlign(LEFT);
fill(0);
stroke(255);
fill(255);
text("Vibrate", width/2 + 5, 60);
}
Thanks in advance for any help.
I'm trying to get a on/off vibrating alert using the Ketai library. I know it should be something along the lines of
vibrate(long[] pattern,int repeat)I'm not sure what I should be putting in for the pattern; I've try a few things from Android developer sites which look similar but I was struggling get them to work.
This is my code
import ketai.ui.*;
KetaiVibrate vibe;
color backgroundcolor = color(0, 0, 0);
void setup()
{
orientation(LANDSCAPE);
textSize(28);
textAlign(CENTER);
vibe = new KetaiVibrate(this);
long[] pattern = {500, 300};
}
void draw()
{
background(backgroundcolor);
}
void mousePressed()
{
vibe.vibrate(pattern, -1);
}
void drawUI()
{
pushStyle();
textAlign(LEFT);
fill(0);
stroke(255);
fill(255);
text("Vibrate", width/2 + 5, 60);
}
Thanks in advance for any help.
1