# Hexapod build Serial

**URL:** <https://forum.arduino.cc/t/hexapod-build-serial/1429732>\
**Category:** General Guidance\
**Created:** [February 8, 2026, 2:08pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732 "2026-02-08T14:08:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntonyG](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/antonyg/32/1126942_2.png) [@AntonyG](https://forum.arduino.cc/u/AntonyG)\
**Post date:** [February 8, 2026, 2:08pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/1 "2026-02-08T14:08:39Z")

</div>

Hi.

I have built this monster [The Github](https://github.com/JakobLeander/hexapod)  
I am trying to get my IPhone to talk to a Arduino Mega via Bluetooth(HC06).  
Reading the Information provided by the author Jakob Leander. I will post it below.

```arduino
const char ACTION_FORWARD = 'F'; // Walk forward
const char ACTION_BACKWARD = 'B'; // Walk backward

```

The commands must be wrapped by [] to reduce risk of corrupted commands  
'(F#)' = Walk Forward '(B#)' = Walk Backward

Read bluetooth command from the HC-06 one character at a time Identify a command starting with '{' and ending with '}'

```arduino
const char startMarker = '\['; const char endMarker = '\]';

```

So the question is from my App what format should I be sending. Examples :- [F#] or [F#] or ['F'#] or another ?? for the forward movement.  
Please ask if you need anymore code or information.

Regards Antony.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 8, 2026, 2:28pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/2 "2026-02-08T14:28:51Z")

</div>

You may want to re-read your post, you have used [ { ( . Which is correct?

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 8, 2026, 2:33pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/3 "2026-02-08T14:33:00Z")

</div>

> [@AntonyG](#):
>
> - [F#] or [F#] or ['F'#]

The HTML of this forum mangles code meant for a computer. Re-write that using the \<code\> button.

Guessing...

```arduino
const char startMarker = '['; // only ONE character between single quotes

```

If you need the escape character...

```arduino
const char escChar= '\';

```

---

<div class="post-metadata">

**Author:** ![AntonyG](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/antonyg/32/1126942_2.png) [@AntonyG](https://forum.arduino.cc/u/AntonyG)\
**Post date:** [February 8, 2026, 7:03pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/4 "2026-02-08T19:03:13Z")

</div>

Hi.

> [@sonofcy](#):
>
> ou may want to re-read your post, you have used [ { ( . Which is correct?

That's just it I have no idea.

> [@xfpd](#):
>
> The HTML of this forum mangles code meant for a computer. Re-write that using the ` button.`
> 
> `
> `

`
This is plain Text from his instructions.
Regards Antony.`

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 8, 2026, 7:10pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/5 "2026-02-08T19:10:39Z")

</div>

> [@AntonyG](#):
>
> `This is plain Text`

What is, and how does it identify what you need versus what you get?

I think you are mixing "single-quote" (') with back-tick(`)... and are using the single-quote where you need the back-tick.

My single-quote is "under" my (unshifted) double-quote key.  
My back-tick is "under" my (unshifted) tilde key.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 8, 2026, 7:16pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/6 "2026-02-08T19:16:33Z")

</div>

Not understanding you at all. If you are saying you don;t understand some set of instructions, post the link to those instrauctions so we can read what you read.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 8, 2026, 7:24pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/7 "2026-02-08T19:24:24Z")

</div>

I looked at the code and do not see any of {[( the ACTION\_FORWARD is just the single char F which in code is 'F' but you only send F.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 8, 2026, 8:00pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/8 "2026-02-08T20:00:56Z")

</div>

I think the user is trying to "protect" the "device" against data not intended to move the device by wrapping the "move" character in brackets. That is to say... `F` is just a character to be discarded or used elsewhere but will not move the device, but `[F]` means "move forward" to the device. And again with `[B]` The brackets acting like an esape character... so the sender is actually sending three characters (if not made into an array of three characters).

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 8, 2026, 8:13pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/9 "2026-02-08T20:13:26Z")

</div>

Ok, that makes some sense. In that case I would use an 'escape' char that is not 'normal input' Maybe a char array of acceptable chars/commands, and/or a char array of 'escape' chars.  
The real secret to this is the handling of the input stream. I still remember as a fledgling programmer back in the 60's being given a similar task. I thin that is where I lost most of my hair. Of course today the 'str...' builtin functions do all the heavy lifting.  
I don't normally give solutions and won't here, but my clue is  
Set up two tasks to handle the input, one a raw get next char and the other the 'smart' string based parser. By task I just mean the normal 'doing many things at once using millis()' See the tutorials section if you dont know about that, there are many tutorials for that kind of pseudo-tasking.  
2nd hint, you need at least 3 (assuming command is 1 and a start and end esc char) raw chars buffered before processing. I would think about 6 or even 9. Use a time frame to decide if input is done.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 8, 2026, 8:17pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/10 "2026-02-08T20:17:09Z")

</div>

> [@sonofcy](#):
>
> I would use an 'escape' char that is not 'normal

Yes.

They are also trying to fit two characters into a `char`... (if compiler allows, only last `char` is used)

```arduino
const char startMarker = '\[';

```

So I hope they read the comment part of this...

```arduino
const char startMarker = '['; // only ONE character between single quotes

```

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 8, 2026, 10:38pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/11 "2026-02-08T22:38:21Z")

</div>

If they don't understand that a char is 1 char, 8 bits then there is NO hope.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 9, 2026, 12:01am UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/12 "2026-02-09T00:01:24Z")

</div>

> [@sonofcy](#):
>
> there is NO hope

I looked at the Github link... and...

The first thing I saw was the commands in Github already are wrapped.... so, the original code is being un-wrapped to wrap it again with brackets? (the [.ino](https://github.com/JakobLeander/hexapod/blob/main/hexapod/hexapod.ino) has all the commands as single characters that get stuffed in the wrappers)

```arduino
    '(H#)' = Home
    '(S#)' = Sleep
    '(F#)' = Walk Forward
    '(B#)' = Walk Backward
    '(L#)' = Rotate Left
    '(R#)' = Rotate Right

```

The second thing I saw was this show stopper:

> It does not work on IoS devices as HC06 module is not compatible with IoS.

Compared to Post #1:

> I am trying to get my IPhone to talk to a Arduino Mega via Bluetooth(HC06).

And show-stopper #3 is the need for a paid application...

> I have used a paid 3-party component to handle low-level bluetooth communication

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [February 9, 2026, 1:03am UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/13 "2026-02-09T01:03:23Z")

</div>

> [@xfpd](#):
>
> It does not work on IoS devices as HC06 module is not compatible with IoS.

Use a HM-10 for iOS

---

<div class="post-metadata">

**Author:** ![AntonyG](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/antonyg/32/1126942_2.png) [@AntonyG](https://forum.arduino.cc/u/AntonyG)\
**Post date:** [February 9, 2026, 7:14am UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/14 "2026-02-09T07:14:21Z")

</div>

Thank you for all the Info... Looking into it Now.  
Thanks 😀  
Regards Antony

---

<div class="post-metadata">

**Author:** ![AntonyG](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/antonyg/32/1126942_2.png) [@AntonyG](https://forum.arduino.cc/u/AntonyG)\
**Post date:** [February 15, 2026, 1:36pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/15 "2026-02-15T13:36:23Z")

</div>

Hi.  
And a BIG thank you. Sonofcy and xfpd for your inputs.  
Its sorted out the issues That I had.  
I have the iPhone talking to a HM-10 Sending and receiving.  
And I have a Android tablet talking to a HC-06 Sending and receiving.  
Now I can progress forward with my build.  
Again a BIG thank YOU.  
Regards Antony.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 14, 2026, 1:37pm UTC](https://forum.arduino.cc/t/hexapod-build-serial/1429732/16 "2026-08-14T13:37:19Z")

</div>

Closed on August 14, 2026, 1:37pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
