How to control Arduino Uno from Xcode

Hello, I download Arduino Serial Sample and Upload program to my arduino Uno, but when I write “a” or “b” in Arduino Serial Sample Example nothing happened and led don’t blink…

List code

String inputString = “”; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
int led = 13;

void setup() {
// initialize serial:
// reserve 200 bytes for the inputString:
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);

void loop() {
// print the string when a newline arrives:

if (inputString=“a”) {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)

if (inputString=“b”) {
digitalWrite(led, LOW); // turn the LED on (HIGH is the voltage level)

// clear the string:
inputString = “”;
stringComplete = false;


SerialEvent occurs whenever a new data comes in the
hardware serial RX. This routine is run between each
time loop() runs, so using delay inside loop can delay
response. Multiple bytes of data may be available.
void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = (char);
// add it to the inputString:
inputString +=inChar;


  if (inputString="a")

double equals.


  if (inputString="a")

double equals.

=( still doesn't work

OK, thanks for letting us know.

Why are you pissing away resources on the String class, reserving space for 200 characters, when you KNOW that the instance will only contain one character?

What does your sending code look like?