Go to Post I decided I would keep coming and it just kept getting more and more fun. By the time build season started going I couldn't have quit if I wanted to ^_^ - Mr. Pockets [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 03-03-2009, 22:58
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
Re: team update #9 "Autonomous - Disabled" - what?

Our robot has a six position switch on a DriverStation analog input, configured to read out 0V, 1V, 2V, 3V, 4V or 5V. I think this will work, can't test it until the regional:

Code:
static int auto_v = 0;
static int autonomousmode = 0;

void DisabledPeriodic(void) {
int auto_v_now;

  auto_v_now = ((int)((m_ds->GetAnalogIn(1))+0.5)) + 1;
  if(auto_v_now == auto_v)
  {
    autonomousmode = auto_v;  // only shift when equal (stable voltage)
  }
  auto_v = auto_v_now;  // always update current state
}
I know that GetAnalogIn() does not return a "float" voltage like GetVoltage() does, so auto_v_now will need scaling. The robot will use autonomousmode to select one of six modes during the autonomous period.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stay in "Search-Begin" while disabled? billbo911 NI LabVIEW 1 17-02-2009 16:32
Alternative "Fix" for IR Sensor to Team Update 10 DarkJedi613 Electrical 6 16-02-2008 22:04
"TEAM in a BOX" : Shipping Update!! OZ_341 General Forum 1 02-10-2005 21:32
Help us Update "Team in a Box" OZ_341 General Forum 20 06-09-2005 01:26
Team Update #19 - "Double Play" George1902 General Forum 31 11-04-2005 01:17


All times are GMT -5. The time now is 13:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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