Go to Post Ahh! I see that you discovered the "CMD_FLING_RECEIVER_RADIO_ACROSS_ROOM" command in the robot scripting language! Nicely done! - dlavery [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 13-01-2004, 18:09
misterikkit's Avatar
misterikkit misterikkit is offline
will code for food
AKA: Jon B
#0258 (Sea Dawgs)
Team Role: Programmer
 
Join Date: Dec 2003
Location: San Jose, CA
Posts: 7
misterikkit will become famous soon enoughmisterikkit will become famous soon enough
Send a message via AIM to misterikkit
Question Trouble with pwm outputs

We're having a hard time with pwm outputs in the default code.

We assign an 8-bit value to, say, pwm02, and then printf pwm02. The output looked like gibberish, but when we printf-ed it in binary format, the 8-bit value was in the high byte of the value.

We've tried various methods of casting, shifting, and other wierd things, all to no avail. (see some examples below) Can anyone help?
Code:
	pwm02 = (unsigned char)Get_Analog_Value(rc_ana_in01)>>2;
	printf("%d\n",  pwm02);
	// output: 10496


Thanks in advance,
Jon B (:
 


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
Tether for new EduBot Controller gburlison Programming 9 18-12-2003 17:53
pwm 13-15 wayne 05 Programming 2 04-10-2003 12:08
PWM and burning out motors patrickrd Technical Discussion 7 19-06-2003 15:30
Hints For Rookie Programmers Noah Programming 30 20-02-2003 20:07
relay and pwm outputs nick_champ_2 Electrical 1 31-01-2003 13:08


All times are GMT -5. The time now is 17:56.

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