LED program need help!!!!

Right for a project i am trying to control 5 LED's using VB. I have the VB code done and it creates a 5bit binary number that i am able to pass to arduino.

What i want to know is how do i split this string up into the separate bits so that i can process each one (which i know how to do)

Walking through bits can be done with bitRead(), http://arduino.cc/en/Reference/BitRead
But you have to convert the serial data to a integer (or a byte).

Thanks for fast reply ill give that a go :smiley:

right iv got it reading the separate bits but how do i reference the bitRead?

p.s. very new to arduino

TheSpook:
right iv got it reading the separate bits but how do i reference the bitRead?

p.s. very new to arduino

Depends on what you mean by "reference the bitRead".

You call the bitRead with something like this:

byte someBit = bitRead(someNumber, someBitPositionInTheNumber);

Or use bitwise and & - Arduino Reference.

Mark