Go to Post Coming soon to an Earth near you; an Australian team (or 2). Stay tuned. - Elgin Clock [more]
Home
Go Back   Chief Delphi > CD-Media > White Papers
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

photos

papers

everything



C Programming and Autonomous Modes for Newbies

cbolin

By: cbolin
New: 16-12-2004 15:07
Updated: 16-12-2004 15:07
Total downloads: 590 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: 16-12-2004 15:07
    filetype: zip
    filesize: 84.38kb
    downloads: 588



Recent Downloaders

Discussion

view entire thread

Reply

19-12-2004 22:35

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!



20-12-2004 07:21

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



09-01-2008 19:32

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 08:30.

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