Arduino Commands:
pixel,red,green,blue Color Values are between 0 and 255
servo1,speed,servo2,speed Speeds are between 0 and 180. 90 is stop
lineRight,speed1,speed2 Speeds are between 0 and 180. 90 is stop
lineLeft,speed1,speed2 Speeds are between 0 and 180. 90 is stop
Code Snippets:
1 2 |
AddButton("buttonControl","button",.2,.2,.2,.1,"blue"); //must have corresponding function |
1 |
addImage(layout,file,Posx,Posy,sizex,sizey); |
1 |
addClickableImage(layout,file,name,Posx,Posy,sizex,sizey); //must have corresponding function |
1 2 3 4 5 |
function button() //change "button" to name of your function { app.Alert("hello world!"); //replace with your code } |
1 |
app.TextToSpeech("replace with your text"); //also add options |
1 |
blueToothSend("pixel,255,0,0"); //replace with your command |
1 |
wait(500); /this pauses application for 1/2 second. Change parameter for different times |
1 |
app.Vibrate("0,500,0"); //add your pattern |
1 2 |
laybuttonControl.SetBackground( "/Sys/Img/GreenBack.jpg"); //this changes buttonControl //layout to green. Modify file the file path for other backgrounds |
1 |
takePicture(); //this takes a photo with the front camera |
1 |
emailSelfie(subject,body,sendTo); // take the picture first. Change the parameters to suit |
1 |
sendMessage(ip,message); //send a message to an IP address. Use "" around ip and message. |
1 |
getIPaddress(); //displays your IP address in a popup |
1 |
blueToothConnect(); //connects bluetooth |
1 2 3 4 |
for( var i=0; i<10; i++ ) //change the 10 to number of times you want to repeat { } |
1 |
app.TextToSpeech( "Your wish is my command ",.8, .9 ,Listen); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
//Start recognizing. function Listen() { // app.HideProgress(); speech.Recognize(); reSpeech= setInterval(checkListening, 6000); //restart listening if stopped } |
1 |
app.AddLayout(layvoiceControl); |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//Called with the recognition result(s). //UNCOMMENT LINE 81 IN MAIN FILE! function speech_OnResult( results, partial ) { clearInterval(reSpeech); //Get result. var cmd = results[0].toLowerCase(); app.ShowPopup(cmd,"Short"); speech.Recognize(); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// //Watch for key phrases. if( cmd=="2100" ) { app.TextToSpeech( "What would you like?", .3,.9, Listen ); } else if( cmd=="andy" ) { app.TextToSpeech( "I will fetch andy", .3,.9, Listen ); } // //Restart recognition. else |