/* import android.content.Intent; import android.os.Bundle; import ketai.net.bluetooth.*; import ketai.ui.*; import ketai.net.*; import android.bluetooth.BluetoothAdapter; import android.view.KeyEvent; */ PImage S,Tune,Vup,Vdown,Play,Stop,Mode; void setup() {size(displayWidth,displayHeight); background(255); //size(600,600); imageMode(CENTER); S = loadImage("S.png"); Tune = loadImage("Tune.png"); Vup = loadImage("Vup.png"); Vdown = loadImage("Vdown.png"); Play = loadImage("Play.png"); Stop = loadImage("Stop.png"); Mode = loadImage("Mode.png"); /* imageloader(); vibe = new KetaiVibrate(this); isConfiguring = true; bt.start(); //start listening for BT connections bt.getPairedDeviceNames(); bt.connectToDeviceByName("HC-05"); textSize((height-width)/35); */ } void draw() { loadImages(); definebuttons(); println(mouseX,mouseY); } void loadImages() { image (S, width/12,height/12,width/12,height/12); image (Tune, width/2,height/1.5,width/1.5,height/4); image (Vup, width/1.1,height/2,width/12,height/12); image (Vdown, width/1.1,height/1.1,width/12,height/12); image (Play, width/1.5,height/3,width/12,height/12); image (Stop, width/2.5,height/3,width/12,height/12); image (Mode, width/1.96,height/6,width/10,height/10); } void definebuttons() { if (mouseY<height/2.5 && mouseY>height/3.5) { if(mouseX<width/2 && mousePressed) { println("STOP"); } if(mouseX>width/2 && mousePressed) { println("PLAY"); } } if ( mouseY<height/3.5 && mousePressed) { println("Mode"); } if (mouseY>height/2.5 && mouseY<height/1.8 && mousePressed) { println("Volume UP"); } if (mouseY>height/1.8 && mouseY<height/1.3 && mousePressed) { if (mouseX<width/2) { println("Chnl left"); } if (mouseX>width/2) { println("Chnl right"); } } if (mouseY>height/1.3 && mousePressed) { println("Volume down"); } }