Go to Post Angry Teams will not get the field going any quicker trust me on that! - mtaman02 [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 29-12-2007, 23:09
Robostang 548's Avatar
Robostang 548 Robostang 548 is offline
I can program the future...
AKA: Don
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Northville Mi
Posts: 69
Robostang 548 is on a distinguished road
Send a message via AIM to Robostang 548 Send a message via MSN to Robostang 548 Send a message via Yahoo to Robostang 548
Manipulating bits

Ok, I'm having a bit of trouble. I have been experimenting with using an off-board and so far everything has been going great. But now I'm having trouble fitting 10 gallons in an 8 gallon hat. My problem is that we have set up the serial link to send 8 bits at a time. Its perfect for sending joystick or pwm values back and forth but what happens when I want to send an integer that I have given an analog value? I know I can bit shift off the two right most bits and then replace them when they get to the coprocessor with zeros. That gives me the same value as when it was sent within 3. My question is, is there a way in c to take the two right-most bits of a value and put them into a byte and then fill up the rest of the byte with other right most bits of values so I don't wast space. I know how to cut this byte back up and distribute the bits to their corresponding values (my coprocessor runs on python) but I don't know how I would package and send something like this in C. Does anyone have a solution to this problem?

-Don
__________________

Team 548:
Attending National Championship, Genesee District, Detroit District 2, West Michigan District, Michigan Championship?


 


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
pic: Sorting drill bits Andy Baker Extra Discussion 12 16-02-2005 21:46
Manipulating tetras from the ground. Petey Rules/Strategy 4 08-01-2005 23:19
Hanging vs. Manipulating 2x balls me9342 Rules/Strategy 41 13-01-2004 09:24
Extracting Individual bits in C Noah Programming 7 08-01-2004 15:53
Sweet Repeat Bits skrussel Off-Season Events 0 09-10-2003 21:13


All times are GMT -5. The time now is 18:45.

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