- Mon Sep 17, 2018 7:13 pm
#200403
Help Please The following code returns !B11 fro iPhone button push. I'm just not sure what that is. It's declared as an integer and I'd like to use an if then statement to see which button is pushed. Can someone help me.
/*
My Example 9/17/2018
*/
#include <SoftwareSerial.h>
int Str1, Str2;
int bluetoothTx = 2; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3; // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial mySerial(bluetoothRx, bluetoothTx); // Set up serial port to pins 2 TX and 3 RX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
}
}
void loop() { // run over and over
if (mySerial.available()) {
Str1 = mySerial.read();
Serial.write(Str1);
//Serial.write('\n'); // Carriage Return
}
}
/*
My Example 9/17/2018
*/
#include <SoftwareSerial.h>
int Str1, Str2;
int bluetoothTx = 2; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3; // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial mySerial(bluetoothRx, bluetoothTx); // Set up serial port to pins 2 TX and 3 RX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
}
}
void loop() { // run over and over
if (mySerial.available()) {
Str1 = mySerial.read();
Serial.write(Str1);
//Serial.write('\n'); // Carriage Return
}
}