Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Insufficient iinformation. You also mentioned some sort of IR output. What's that got to do with the joystick?
    I no longer wish to be associated with this site.
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    I understand that reasoning.

    Here's what I want. I push the joystick to the top right diagonal and have the IR transmitter send a signal of 200 (units?). To get the IR part, I know that I use the setServo command and use a value of 200, so whatever code it is to use the "diagonals", it will need to have the following code in it somewhere.
    Code:
    setServo(0,200)
    The 0 is to tell which servo to move. I just decided to use 0 for this.

    @jwdonahue: The IR I mentioned is treated as a servo within the BRAIN, and we are trying to use the joystick diagonals to send IR signals.
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    I still don't have a good enough design picture in my head here.

    So you're problem is figuring out how read when the joystick is on one of the diagonals? Is the right?
    I no longer wish to be associated with this site.
  6. #19
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Well it seems you already got your answer at the Yahoo site:

    http://tech.groups.yahoo.com/group/bestinc/message/940

    How's that working for you?
    I no longer wish to be associated with this site.
  8. #20
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    Ha yes I just saw that reply. I'm at home so I can't program the BRAIN to find out if it works, but I'll try it as soon as I can.

    I have most of the errors sorted out, but at the second { bracket, it says "error-expected a declaration" so I'm not sure what to change there because it looks fine to me.
    Code:
    void outInt(char* label,int n)
    {
    char szTemp[16];
    outHostsz(label);
    itoa(n,szTemp);
    outHostsz(szTemp);
    }
    
    {
    
    InitBrain();
    
    setServoRange(IR_SERVO,180);
    }
  10. #21
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2009
    Posts
    837
    Rep Power
    527
    Well, you've completely corrupted the code that was posted in the yahoo message board.

    So go back to that and compare with what you just posted: you'll see the problem immediately.
    Last edited by MadDogBrown; October 22nd, 2009 at 11:38 PM.
  12. #22
  13. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Originally Posted by Apetrunk
    Ha yes I just saw that reply. I'm at home so I can't program the BRAIN to find out if it works, but I'll try it as soon as I can.
    I think you can load all the IAR tools on your home system and run the simulator. I know I have developed whole programs that way while waiting on the hardware folks to deliver a usable prototype.

    As for you compiler error, that's because you seem to have a code fragment. See my comments in the code.

    void outInt(char* label,int n)
    {
    char szTemp[16];
    outHostsz(label);
    itoa(n,szTemp);
    outHostsz(szTemp);
    } // Outint() ends here

    { // Opening scope here? No enclosing function. Did you forget main()?

    InitBrain();

    setServoRange(IR_SERVO,180);
    }
    Last edited by jwdonahue; October 22nd, 2009 at 11:44 PM.
    I no longer wish to be associated with this site.
  14. #23
  15. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Originally Posted by MadDogBrown
    BTW, "main" should return int, not void.
    That only applies to "hosted" environments. Target environments that "run on the metal" are not required to even have a main() and there is no program entry point signature requirement, though most embedded systems at least tolerate a main() by default. Some require you to specify the entry point by external means (build parameters, executable header format, etc.). These guys are running on an MSP430, believe me, it's not a "hosted environment".
    I no longer wish to be associated with this site.
  16. #24
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2009
    Posts
    837
    Rep Power
    527
    Originally Posted by jwdonahue
    That only applies to "hosted" environments. Target environments that "run on the metal" are not required to even have a main() and there is no program entry point signature requirement, though most embedded systems at least tolerate a main() by default. Some require you to specify the entry point by external means (build parameters, executable header format, etc.). These guys are running on an MSP430, believe me, it's not a "hosted environment".
    Oh right.

    Duh.

    What O/S would main return a value to? (none in this case)

    Man, I'm slipping: I shouldn't post while distracted.
    Last edited by MadDogBrown; October 22nd, 2009 at 11:40 PM.
  18. #25
  19. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    If if there was one ([url=http://en.wikipedia.org/wiki/MicroC/OS-II]uCosII[/quote] comes to mind), it still doesn't qualify as a "hosted environment". I think that term normally applies to environments capable of actually running a compiler and linker, or at least sophisticated enough that a process return would have some sort of use. With micros like these, if there was an OS, application termination usually shuts-down or restarts the device, so all context is lost.
    I no longer wish to be associated with this site.
  20. #26
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    I have done this!


    I am the programmer for my BEST team and I learned a great deal of C programming last year. This year I faced a similar situation. It can mostly be solved by the information on the BEST forums.

    You have two options: number one: execute the IR commands in tangent with the ARM and GRABBER commands ; or option two setup your controls with a mode select on the left vertical joy stick. Both of these depend on your current setup and if your willing to change.

    How is your control currently setup?
  22. #27
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    Well, my original question was answered, but oh well.

    We currently have our end effector set up as a servo on channel 3 (programmed as channel 2) and the arm on channel 4. Then, in each diagonals is a different IR "signal", plus the motor for the arm shuts off so that we don't have a spazzing arm.
  24. #28
  25. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    BTW guys, we now have an embedded programming forum for this sort of thing.

    I'll see if I can't get one of the moderators to move this thread for us...
    I no longer wish to be associated with this site.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo