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

Digital input/output

Expand Messages
  • mac.morham
    I would like to Attach servos to the 13 digital input outputs however the example code only allows for one to be used at a time and I need to be able to use
    Message 1 of 4 , Jan 11, 2011
    • 0 Attachment
      I would like to Attach servos to the 13 digital input outputs however the example code only allows for one to be used at a time and I need to be able to use them at the same time, I have tried but i get a strange error that happens when i run the program on the robot however it compiles fine, i at least need to be able to control them sequentially.
    • eckman.matt@ymail.com
      Could you provide an example of the code you are trying to use?
      Message 2 of 4 , Jan 13, 2011
      • 0 Attachment
        Could you provide an example of the code you are trying to use?

        --- In intellibrain@yahoogroups.com, "mac.morham" <mac.maniac77@...> wrote:
        >
        > I would like to Attach servos to the 13 digital input outputs however the example code only allows for one to be used at a time and I need to be able to use them at the same time, I have tried but i get a strange error that happens when i run the program on the robot however it compiles fine, i at least need to be able to control them sequentially.
        >
      • MacM
        import com.ridgesoft.intellibrain.IntelliBrain; import com.ridgesoft.intellibrain.IntelliBrainDigitalIO; public class IntelliBrainDigitalOut { public static
        Message 3 of 4 , Jan 14, 2011
        • 0 Attachment
          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.
        • eckman.matt@ymail.com
          I believe you will have to specify each different servo separately. For example: IntelliBrainDigitalIO outputOne = IntelliBrain.getDigitalIO(1);
          Message 4 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.