Go to Post I hate mini-bots. - Gdeaver [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #1   Spotlight this post!  
Unread 24-01-2004, 18:03
LoyolaCubs LoyolaCubs is offline
Registered User
#1453
 
Join Date: Jan 2004
Location: Los Angeles
Posts: 3
LoyolaCubs is an unknown quantity at this point
Angry problems assigning unsigned chars in FRC Code

Whenever I assign variables (including competition_mode, autonomous_mode, pwm01, and pwm02), the variable values turn into 256x whatever I assigned. For instance, if I give pwm01 the value 127, the value returned after I use a printf command is 32512. Here is my code in my Stop function (located in the User_Autonomous_Code function):

void Stop (int counter1) // Drive forward until counter reaches zero
{
while( counter1 > 0 )
{
counter1--;
pwm01 = 127;
printf("pwm01: %d\n", pwm01);
pwm02 = 127;
printf("pwm02: %d\n", pwm02);
printf("should be stopped \n");
printf("counter1: %d\n", counter1);
}
}

Anyone have a similar problem or know how to fix it?
 


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
FRC default code hedgehogger Programming 2 21-01-2004 18:41
Problem with FRC Default code AsimC Programming 2 11-01-2004 19:22
ADC problems with C library and new code Larry Barello Programming 1 09-01-2004 22:31


All times are GMT -5. The time now is 16:54.

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