Hello, I am developing an app that will use bluetooth and return values to an app. I am having some problems using my Arduino (Uno rev3) Development board to send data to the board from my arduino program. I am using a sample code to test with turning on and off an LED. So far I have tested the Arduino code with its serial monitor to send data and it seems that it accepts sending the "D" letter value. I believe it is accepting its command because it is used to its own protocol of bytes or something similar. I am not sure if I am using the correct command to send data from my android to the arduino here is a snippet of the command to send a capital "D" to turn on a LED:
public class LEDtest extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.ledtest);
final Button tbutton = (Button) findViewById(R.id.tbutton);
tbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ConnectedThread.write("D".getBytes());
}
});
}
}
I want to know if there's a command that will change it to to a universal protocol of bytes or if there's something I'm missing.
public class LEDtest extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.ledtest);
final Button tbutton = (Button) findViewById(R.id.tbutton);
tbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ConnectedThread.write("D".getBytes());
}
});
}
}
I want to know if there's a command that will change it to to a universal protocol of bytes or if there's something I'm missing.