![]() |
|
#1
|
|||
|
|||
Potentiometer offset?Using Motorola HC68...Designing a game of Pong using potentiometer to control the bat (paddle). The potentiometer's range is between 0-255 and the screens range that it needs to cover is between 0-50...
I was trying to multiply/divide using the following to get the correct reading - ADC_input * 50 / 256. I was trying to multiply using instruction MULU. I tried ADC_input * 2, just to see if it would work and it did up until a certain value and then it just kept randomly multiplying no matter which way I turned the potentiometer. I presume its something to do with mixing up bytes with longs. Any help or better methods in getting the correct input? |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two bugs in my program that just won't go away. | randomperson133 | Assembly Language | 1 | 23-Mar-2008 07:04 |
| Trying to read BMP files, header information is wrong / offset | Algar | CPP / C++ Forum | 5 | 24-Feb-2008 03:00 |
| Thread synchronization Assignment help!! | rossi143 | C Programming Language | 1 | 25-Mar-2007 20:10 |
| Pcap programming in C++ | goal86sg | CPP / C++ Forum | 2 | 25-Jan-2006 14:02 |
| Dynamic Memory Allocation - Offset Pointers | wu_weidong | C Programming Language | 6 | 24-Feb-2005 09:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The