ok
i well try it tonight and back to you with the result
i want to ask about APDE is it working with sound library
i???
ok
i well try it tonight and back to you with the result
i want to ask about APDE is it working with sound library
i???
Yes, you can find an adapted version of the sound lib for the APDE on my Github repo.
The best thing you can do to see how to handle the String Str, is to println() it, and visualize it in the console.
give me the link if you please of the sound library
thanks
hi sir
i have tried this sketch but did not work with me
what i miss ???
import ketai.net.bluetooth.*;
import android.os.Bundle;
import oscP5.*;
import netP5.*;
OscMessage m;
KetaiBluetooth bt;
String str = "myData";
int start_time;
void setup() {
bt.start();
m = new OscMessage(str);
}
void draw() {
if (millis() - start_time > 300) {
bt.broadcast(m.getBytes());
start_time = millis();
}
}
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bt = new KetaiBluetooth(this);
}
Was there any error? Did you give the Bluetooth permissions? If on APDE did you run in App mode?
no error just white screen i run it in App mode and give Bluetooth permissions
That’s good, but now you have to pair your phone with another Android phone and install the app I mentioned above to visualize the bytes you are sending.
i did
no result just white screen
i try the serial terminal on both tablets they send to each other ((with out the sketch))
Did the terminal app connect to the sender phone?
Just to get it right.
I have to think about that, because I use this all the time to see what I am sending, and it doesn’t fail.
ok
let us make the terminal send to the sketch do you have ready code for this ?
Try first to read the bytes send by your HC-05 to your phone with the terminal app.
i am working on that
When you have this working try to read the bytes with this code on your phone.
The name must be exactly that of your HC-05 module and be sure that there are no other modules paired, to avoid conflicts. Also on the Arduino side set a delay(100), 100 ms between each (short) write(); command.
import ketai.net.bluetooth.*;
import android.os.Bundle;
String device_name = "HC-05";
String Str;
KetaiBluetooth bt;
void setup() {
fullScreen();
orientation(PORTRAIT);
bt.getPairedDeviceNames();
bt.connectToDeviceByName(device_name);
bt.start();
textSize(60);
textAlign(CENTER);
}
void draw() {
background(0, 0, 200);
text(Str, width/2, height/2);
}
void onBluetoothDataEvent(String who, byte[] data) {
Str = new String(data);
println(Str);
}
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bt = new KetaiBluetooth(this);
}
hi sir
do i have to use this line or not ?
String device_name = "HC-05";
//String device_mac = "40:45:DA:00:25:05";/// this line i mean