| jdsanchez |
hi!
im a kind of freshmen about USB with PIC, i donwloaded the code from Microchip bit it isnt work, i miss a file named "pic.h", somebody know where can i find it?
maybe im lookink at the wrong file at Microchip's page, but i dont know
someone please help me |
| chib |
Hi !
I have just put : YVel=ReadADC();
YVal=YVel/2;
Yval=YVal/2;
and XVel=ReadADC();
XVal=XVel/2;
Xval=XVal/2;
and it works so I don't edit ..... lol
I have 2 conversion, but if it's a ok for a mouse, it will be ok for my application !
Thanks a lot Dariog !! it was very helpful !
Now I have an other Pb but it's something else so I will make a new thread and I think you can help me .... (if you have some time, obviously)
(if somebody want my whole conveter i can post it) |
| dariog |
Hi Chib, sorry, I was not online...
but I see you did succed! very good!!
To convert 10 bits to 8, you can divide by 4 or shift twice to the right i.e. XVel >>= 2;
To make it faster, well... usually that should not take longer than some uSecs... if I'm not wrong.
How often are you calling the conversion routine? I usually put it in a interrupt, or in the main loop via a divider (usually some 20..100 samples a sec is okay for a mouse) |
| chib |
hello it's me (again)
for the ten bit I dived by 2 and then by 2 and it works !
so I have a working A/D converter, I have another pb but it is different, i will make a new thread tomorow
see ya ! |
| chib |
hum ....
I am stupid ... for a 10 bit i hav defined an 8 bit number ....
So the pb with the 1 is solved .... |
| chib |
hew sorry again ...
in the watch i have seen that :
00000110 10111101
the two bit in bold are always at 1 !!
why ? |