[more] Smoky Mountain Regional : 18d 15h 20m ... Orlando Regional : 25d 15h 20m ... Peachtree Regional : 32d 15h 20m ...
Go to Post I think being successful in FIRST is creating an environment where people can grow, learn, change, and recreate... It's about making an environment where kids feel they can be successful... in whatever discipline they choose. - ColleenShaver [more]
Home
Go Back   Chief Delphi > CD-Media > White Papers
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
Tormach
ADVERTISEMENT

photos

papers

everything



C Programming and Autonomous Modes for Newbies

cbolin

By: cbolin
New: 12-16-2004 03:07 PM
Updated: 12-16-2004 03:07 PM
Total downloads: 465 times


Hi,
This file contains three documents.

C Programming Guide (34 pages)
========================
Uses free IDE/Compiler so students can learn and practice the basics of C programming at home or school. Allows students to understand how to read and make meaningful changes in the Robot default ...

Hi,
This file contains three documents.

C Programming Guide (34 pages)
========================
Uses free IDE/Compiler so students can learn and practice the basics of C programming at home or school. Allows students to understand how to read and make meaningful changes in the Robot default code.

Autonomous Programming (12 pages)
===========================
Explains 9 modes of autonomous operation. All code tested and verified on an actual robot. Great place to start when you don't know where to start.

Programming Notes (6 pages)
======================
Demonstrates several pieces of code that makes programming more interesting. I use this because my memory forgets within 24 hours.

Good Luck in 2005
With Regards,
Chuck Bolin, Team 342

Attached Files

  • zip C Programming and Autonomous Modes for Newbies

    1103227678programmingteam342.zip

    downloaddownload file

    uploaded: 12-16-2004 03:07 PM
    filetype: zip
    filesize: 84.38kb
    downloads: 463



Recent Downloaders

Discussion

view entire thread

Reply

12-19-2004 10:35 PM

Billfred


Unread Re: White Paper Discuss: C Programming and Autonomous Modes for Newbies

Congratulations, Chuck--I guess it takes a South Carolinian to speak to a South Carolinian. This is the first programming white paper that actually clicked with me. (I'm not a programmer by any stretch. But I guess that's obvious).

One question, on the line tracking example in the autonomous notes...at Position D, when the left sensor is made, shouldn't the robot turn to the left instead of the right?

But other than that, bravo!



12-20-2004 07:21 AM

Gamer930


Unread Re: White Paper Discuss: C Programming and Autonomous Modes for Newbies

I read this yesterday morning. I thought it was great also. I sent him a PM with my thanks.
I didn't notice this error yesterday but now reading it again I do see it. It seems like he messed up that whole section.

Here is what I think It should look like:

Code:
//place this line before while (autonomous_mode).
	unsigned char s_left = rc_dig_in01;
	unsigned char s_middle = rc_dig_in02;
	unsigned char s_right = rc_dig_in03;
//place this after Getdata(&rxdata);
if (s_left == 0 && s_middle == 1 && s_right == 0) 
// Middle sensor on
// Go straight
{
	pwm01=160; //left motor
pwm02=160; //right motor
}

else if (s_left == 1 && s_middle == 1 && s_right == 0) 
// Left 2 sensors on
// Turn soft Left
{
pwm01=127; //left motor
	pwm02=160; //right motor
}

else if (s_left == 1 && s_middle == 0 && s_right == 0) 
// Left sensor on
// Turn Hard Left
{
pwm01=127; //left motor
	pwm02=180; //right motor
}

else if (s_left == 0 && s_middle == 1 && s_right == 1) 
// Right 2 sensors on
// Turn soft right
{
pwm01=160; //left motor
pwm02=127; //right motor
}

else if (s_left == 0 && s_middle == 0 && s_right == 1) 
// Right Sensor on
// Turn Hard Right
{
pwm01=180; //left motor
	pwm02=127; //right motor
}

else 	 //stop
{
pwm01=127; //left motor
	pwm02=127; //right motor
}
The other error I saw was in Table 3 First Row, First Column (on the bottom of page 5), that should be Turn Left. The numbers and diagram is still correct

Again, Great Job Chuck



01-09-2008 07:32 PM

Computermaster


Unread Re: White Paper Discuss: C Programming and Autonomous Modes for Newbies

I am a newbie; this is my first year in FRC. I know how to program in many other languages, but C is a new one for me. If anyone has any tips or advice on programming for a newbie, I'd be much obliged. All I have to learn it at home is a college textbook...I'm a freshmen in High School! Anyway, any help would be greatly appreciated. Thanks!



view entire thread

Reply

Tags

loading ...



All times are GMT -5. The time now is 01:39 PM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School