CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 21 matches
CCS Forum Index
Author Message
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Sat Mar 17, 2012 11:09 pm   Subject: Data Conversion
No in built function? That's a pain.

Final question then on this, I've been looking round on ways to select bits that I want to put into the resultant co-ordinate.

I've found something called bi ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Sat Mar 17, 2012 10:56 pm   Subject: Data Conversion
The documentation I have used is this:
http://alumni.soe.ucsc.edu/~inio/wiipaper.pdf

If you look at section B.4.2 that shows the format that the data is in.

However after using bit_test and bit ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Sat Mar 17, 2012 9:35 pm   Subject: Data Conversion
MPLAB Simulator? Not heard of that at all.

OK, so for the first point the three bytes are, for example:

X LSBs 11001010
Y LSBs 01011010
Size and MSBs 01000100


So, to ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Sat Mar 17, 2012 9:15 pm   Subject: Data Conversion
Right, I finally have the correct data!

However, it's not done in an elegant form, I'm having to literally bit-test the bytes and then bit_set or bit_clear the data.

The data is in the form of 8 ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 2:51 pm   Subject: Data Conversion
I'm an idiot. My restarted code had the function for intialising the camera, but didn't actually call that function.

So now I'm at a good stage I think. It's reading data, it's giving it up to a ma ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 2:36 pm   Subject: Data Conversion
Have included and still no joy.

Every single time it does the if statement, it sets the bits, all of them.
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 2:29 pm   Subject: Data Conversion
Well, I've created a new project, so as to clear out all the bits of code I've tried here and there. So I'm focusing on one point only, initialising the camera and reading it.

I started off trying ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 1:40 pm   Subject: Data Conversion
int out_data[12];
int i;
int x1, x2, x3, x4;
int y1, y2, y3, y4;
int s, s2, s3, s4;
int result;


Those are my declarations. So that explains why I need int16 then.
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 1:15 pm   Subject: Data Conversion
In the code I gave, s comes from 5, because that is the second point, should have just given the first.
The 12 bytes start from 0 and go up to 11.

Therefore:
x1 - array 0
y1 - array 1
s1 - arra ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 11:50 am   Subject: Data Conversion
Tried int16 and no go.

But thought more about what that snippet above means and think it means this:

For one point, 3 bytes of data are sent. This is split up into the following format:

1st b ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 7:29 am   Subject: Data Conversion
Blob size is just the data that tells the PIC how large an IR source it has detected. So if it's a smaller blob, then it's only just about catching the point, it's a weak source, or a large blob is ve ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Thu Mar 15, 2012 6:46 am   Subject: Data Conversion
I have used that also. The reading the data off the camera isn't the problem, it's how I'm taking that data that has been read in and interpreting it.

The code there stores the data in an array of ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Wed Mar 14, 2012 10:03 pm   Subject: Data Conversion
Here's a link for the source code I used:

http://procrastineering.blogspot.com/2008/09/working-with-pixart-camera-directly.html
My code is pretty similar to it, apart from some changes to shorten ...
  Topic: Data Conversion
FreakShow!

Replies: 25
Views: 26742

PostForum: General CCS C Discussion   Posted: Wed Mar 14, 2012 8:37 pm   Subject: Data Conversion
Hi,

I've been working on a Pixart Wii IR camera for a project. So far I've managed to pull off data from the camera, which all works.

The data is being saved as bytes from an i2c line. However, ...
  Topic: i2c.h not found?
FreakShow!

Replies: 6
Views: 12282

PostForum: General CCS C Discussion   Posted: Thu Feb 16, 2012 3:01 pm   Subject: i2c.h not found?
Thank you for all your help. I will read carefully.
 
Page 1 of 2 Goto page 1, 2  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group