Arduino Control Desktop - ACiD

(deleted)

(deleted)

First off, this looks like a very useful project, most likely as a debugging tool - I think it is something that should be submitted to the playground once you have it past the beta stage.

What I would suggest improving, though, is removing the redundant code; you have many areas that could be simplified into singular functions (such as the banner output), as well as where loop constructs or other constructs could be applied. Doing these things would vastly simplify the sketch, and likely reduce its footprint (size) on the Arduino.

:slight_smile:

(deleted)

(deleted)

(deleted)

(deleted)

(deleted)

The first time I was able to upload it to the board. Then I opened up the serial, but the only things I got were:

))))))©JBJÂ
)J-B

JJ)J-))))))      Æ


HJ

R
HFBHB

And so on. I tried resetting the board, but I got the same. Then I tried re-uploading, but I got an 'error compiling'... I closed the IDE, and re-opened it, now I was able to reupload your code, but still the same characters... Has it something to do with the fact I try it with the serial monitor?

EDIT: when I tried to open up a serial example and upload that sketch to verify my serial works, it also had to reopen the IDE and then it worked fine...

doublet are you using 57600 BAUD in the serial monitor?

(deleted)

facepalm
I left baud at default... Now working fine at 57600, like you both said. Awesome program! Totally working fine! I only could complain about no PWM and the #'s who are not aligned right... :slight_smile:

(deleted)

Here is a screenshot of the serial monitor:

(deleted)

(deleted)

(deleted)

I'd recommend using a separator between commands if your going to send them all in a row. Then you can make a parsing function that will know how to keep commands apart,and that it needs to read a value after receiving certain commands. You could do something like:
"x|p9128|x", and just read the first character of every command to determine the command type, then pass the specific commandstring for further parsing, or use something like"x|p|9|128|x", but that would not make things easier.

Reading strings into integers could be done with something like sscanf(inputstring, "%d", integer) I suppose (havent used this in Arduino yet myself so I dunno if the syntax is correct, but it's pretty basic C). If you choose your command format wisely you can read all values in one command using sscanf.

(deleted)