mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
blue book examples
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import processing.phone.*;
|
||||
Phone p;
|
||||
|
||||
void setup() {
|
||||
p = new Phone(this);
|
||||
noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop
|
||||
}
|
||||
|
||||
void keyPressed() {
|
||||
switch (key) {
|
||||
case '1':
|
||||
// Vibrate the phone for 200 milliseconds
|
||||
p.vibrate(200);
|
||||
break;
|
||||
|
||||
case '2':
|
||||
// Flash the backlight for 200 milliseconds
|
||||
p.flash(200);
|
||||
break;
|
||||
|
||||
case '3':
|
||||
// Dial 411 on the phone
|
||||
p.call("411");
|
||||
break;
|
||||
case '4':
|
||||
// Launch the Web browser
|
||||
p.launch("http://mobile.processing.org/");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user