Loading ...
Sorry, an error occurred while loading the content.

Re: Digital input/output

Expand Messages
  • eckman.matt@ymail.com
    I believe you will have to specify each different servo separately. For example: IntelliBrainDigitalIO outputOne = IntelliBrain.getDigitalIO(1);
    Message 1 of 4 , Jan 20, 2011
    • 0 Attachment
      I believe you will have to specify each different servo separately. For example:
      IntelliBrainDigitalIO outputOne =
      IntelliBrain.getDigitalIO(1);
      IntelliBrainDigitalIO outputTwo =
      IntelliBrain.getDigitalIO(2);
      IntelliBrainDigitalIO outputThree =
      IntelliBrain.getDigitalIO(3);
      IntelliBrainDigitalIO outputFour =
      IntelliBrain.getDigitalIO(4);
      IntelliBrainDigitalIO outputFive =
      IntelliBrain.getDigitalIO(5);

      and so on and so forth. The "variable" name has to be different for each servo number, outputOne, outputTwo, outputThree. Also you have to set the direction of each servo separately. I am beginner but from my understanding that's how it would work. Give it a try and let me know. Another reason for the error could be your try/catch commands.

      --- In intellibrain@yahoogroups.com, "MacM" <mac.maniac77@...> wrote:
      >
      > import com.ridgesoft.intellibrain.IntelliBrain;
      > import com.ridgesoft.intellibrain.IntelliBrainDigitalIO;
      >
      > public class IntelliBrainDigitalOut {
      > public static void main(String args[]) {
      > try {
      > IntelliBrainDigitalIO output = IntelliBrain.getDigitalIO(10);
      > output.setDirection(true);
      >
      > while (true) {
      > Thread.sleep(10);
      > output.toggle();
      > }
      > }
      > catch (Throwable t) {
      > t.printStackTrace();
      > }
      > }
      > }
      >
      >
      >
      >
      >
      > That Is The Example They Give. But you can only make one servo move and if I change it to this "IntelliBrainDigitalIO output = IntelliBrain.getDigitalIO(1-10);" it compiles fine but the robot outputs an error. even if I "IntelliBrainDigitalIO output = IntelliBrain.getDigitalIO(1-2);" same weird message give it a try. I think its saying it doesn't have the battery power to do that but im not sure as I couldn't find that message anywhere on the net.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.