Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I am making a animatronic hand that is powered by two Arduinos connected via XBee radio's. I am very new to coding and this is my first attempt. I was wondering if you guys could help me a little as as of now I don't know if it works as I don't have the Ardunios and I would like to try to get the code perfect before the build as that is going to be a difficult job! Could you guys help clean up this code a bit as well? Thanks in advance!

Here is the hands code:


Here is the glove code:


Thanks very much!

share|improve this question

closed as off topic by Corbin, palacsint, Trevor Pilley, Jeff Vanzella, Brian Reichle Nov 8 '12 at 21:01

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm afraid questions without inline code are offtopic here (according to the FAQ). Could you include the code into the question, please? –  palacsint Nov 7 '12 at 22:59
add comment

1 Answer 1

Knowing nothing about Arduino or hands, I can safely say the above code cannot be correct.

I'm just throwing some things that jump to the eye:

  1. You wait for 5 bytes on the serial buffer, and than you read MAX_FINGERS times in the loop. So if MAX_FINGERS != 5, you'll be out of order next time.
  2. It's hard to believe the byte that you write() to the servo, by itself, has any meaning. There has to be some conversion there.

Just in a glance. Attach full code next time and good luck with the project!

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.