|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#15
|
||||
|
||||
|
there is one way to give feedback of all 16 PWMs, and all it requires is a pot and some coding knowledge.
i just thought of this now, so i think it should work, someone may want to check this though. second, probably a bad idea for use during a competition, due to extra code. first of all, plug your joystick in, as we have the wheel that we can use as a pot (yay!). Divide 255 by 16, we get approximately 16, but since it's PBASIC, let's truncate and make it 15. Down at the very bottom of your code, after everything but the SEROUT (this way you're sure to be outputting the correct values), but something like this (excuse any syntax errors, it's been a few months )...switch (wheel_var) case 0 to 15: out8 = pwm1.bit0 out9 = pwm1.bit1 out10 = pwm1.bit2 out11 = pwm1.bit3 out12 = pwm1.bit4 out13 = pwm1.bit5 out14 = pwm1.bit6 out15 = pwm1.bit7 case 16 to 30: out8 = pwm2.bit0 out9 = pwm2.bit1 out10 = pwm2.bit2 out11 = pwm2.bit3 out12 = pwm2.bit4 out13 = pwm2.bit5 out14 = pwm2.bit6 out15 = pwm2.bit7 and so on till you get up to pwm 16. turn the wheel, you can probably estimate the distance needed pretty easily, otherwise you can very easily output it to a laptop computer and see what pwm you're getting (i believe the wheel on port 2 is sent back already). now, if you have the 2003 controller, put it into User Mode, and you get the pwm values right there on the controller, nothing else needed. if you don't have the 2003 controller, i'm sure there is a program, or i'm willing to write a quick and dirty command promt program that will simply output the pwm value (converted back into decimal or 0 - 255). as I said, this is not the best code to have in a competition ready robot, but as long as you're just testing, i guess it's fine. DISCLAIMER: I think this should all work, but I haven't tested it (because I'm too lazy to boot into Windows, find my old robot code, add this in, and plug it into the controller sitting on my desk). If you have any problems (like robots blowing up or killing people) either you did something wrong, or it's a hardware problem .<EDIT> Sorry about the lack of spacing, but I can't think of any other way to make it space correctly</EDIT> |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom dashboard program available. Interest? | archiver | 2001 | 4 | 24-06-2002 00:45 |
| Dashboard Decoder Release Version 1.0 Now Available! | archiver | 2000 | 1 | 23-06-2002 22:50 |
| Dashboard Protocol Library | archiver | 2000 | 9 | 23-06-2002 22:24 |
| New Innovation FIRST control system and the dashboard | archiver | 2000 | 0 | 23-06-2002 22:15 |
| Dashboard Viewer | Khalicl13 | Technical Discussion | 8 | 15-06-2001 23:36 |