Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Hybrid Mode Help (http://www.chiefdelphi.com/forums/showthread.php?t=63004)

ShotgunNinja 31-01-2008 21:23

Hybrid Mode Help
 
Hello. I am my team's website guy and, new to this year, programmer. I have ROBOTC 1.14 installed on the team comp, and I (somewhat) grasp the coding language, but I am having problems with the hybrid mode. Here are some of my questions:

- How would I interface with the hybrid mode controls? (We are using a standard TV remote)
- Can I still utilize the Code Template that came along with the ROBOTC program? (void main(), task Autonomous(), task Human_Control())
- Does the ROBOTC language allow typedef structs like ANSI C does?
- Why does the compiler hate me so much?

cardinalman86 31-01-2008 21:55

Re: Hybrid Mode Help
 
here, check this thread out. it really helped me and let me do what i wanted to do with the programming. Good Luck.

timville 01-02-2008 11:07

Re: Hybrid Mode Help
 
Hi ShotgunNinja

If you wanted to interface with the Hybrid Mode with the IR, we actually have a sample to do. Here's the code for the Initialization and Autonomous Sections:

Code:

#include "FRC_Comp_Include.c"

void Initialization()
{
        bMotorReflected[port2] = true;  //Reflect Motor
        frcDigitalIODirection[pio3] = dirInput;  //IR Output 1 on Digital IO 3
        frcDigitalIODirection[pio4] = dirInput;  //IR Output 2 on Digital IO 4
        frcDigitalIODirection[pio5] = dirInput;  //IR Output 3 on Digital IO 5
        frcDigitalIODirection[pio6] = dirInput;  //IR Output 4 on Digital IO 6
}

task Autonomous()
{
        int IRswitch1;
        int IRswitch2;
        int IRswitch3;
        int IRswitch4;

        while(true)
        {
          IRswitch1 = frcDigitalIOValue[pio3];  //Update Variables
          IRswitch2 = frcDigitalIOValue[pio4];  //So we can see status in the Debugger
          IRswitch3 = frcDigitalIOValue[pio5];
          IRswitch4 = frcDigitalIOValue[pio6];

          if(IRswitch1 == 1)  //If Switch 1 is pressed (it pulses, doesn't remain on)
          {
            motor[port1] = 50;
            motor[port2] = 50;
          }

          if(IRswitch2 == 1)  //If Switch 2 is pressed
          {
            motor[port1] = 0;
            motor[port2] = 0;
          }

          if(IRswitch3 == 1)  //If Switch 3 is pressed
          {
            motor[port1] = -50;
            motor[port2] = 50;
          }

          if(IRswitch4 == 1)  //If Switch 4 is pressed
          {
            motor[port1] = 50;
            motor[port2] = -50;
          }
        }
}

Yes, You can use Typedef structs like ANSI C.

What issues are you having with the compiler?

I recommend you take a look at some of the support/samples we have at the ROBOTC website: http://robotc.net/ifi/frc/support.htm

feliks_rosenber 01-02-2008 14:34

Re: Hybrid Mode Help
 
Hello!

I am the mentor of team 2669 from Kiryat Yam, Israel.

We stand behind the Hybrid4all initiative aimed at helping teams get started with their autonomous mode.

Here is a link to a presentation explaining about the basics.

http://www.chiefdelphi.com/media/papers/tags/frc2669

To the left you will find another presentation about our 'Go Black' initiative.

To the right you will see the presentation of Hybrid4all.

If you have any questions feel free to contact Team2669 KY Bots!


All times are GMT -5. The time now is 23:06.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi