My car
Posted: 15 Oct 2010, 02:23
Hey there, I have a wonderful idea that's been in my head for awhile. I just recently started building it, and it's almost finished (well, at least half of it is).
I am working on a remotely controlled NXT car. The controller is a second NXT, with two Forward/Backward joysticks on either side. I have built the car, but the programming is nowhere near being finished. The controller is nowhere near being finished, but the programming is (almost) done.
Currently, I have the basic program setup worked out, and I have a even more basic build design, I'm still working on that in my head. However, it's this particular aspect of the controller's joysticks that I need help programming.
My idea is to feed two motor's rotation vales (one on the left, one on the right) as the Joystick values, thus creating two Forward/Backward sticks, not a Throttle/Steering setup (ugh). I was planning on having it set up so that when the stick is pointing straight up, it's at the neutral position. Then, it could recognize forward and backward commands, on each stick. However, I wanted to ensure that the stick returned to the neutral position, so that if you pushed up on the stick and then let go, it would drop back down. This could easily be accomplished by springs, but if it was accomplished via programming, then you could apply it elsewhere. (Not to mention, the NXT doesn't come with springs.)
Currently I am attempting a setup where the Controller reads a motor's rotation value in degrees (as a variable), reduces it some, and then tells the motor to move the opposite direction with the variable going to the power input. This seems to be causing many problems, however. If anyone can help me, I would be delighted. I can send whatever I need to send to you (screenshots, program itself, etc.), just ask and you shall receive. (I would post it here, but I have no idea how.) Thanks in advance!
- Stryker
I am working on a remotely controlled NXT car. The controller is a second NXT, with two Forward/Backward joysticks on either side. I have built the car, but the programming is nowhere near being finished. The controller is nowhere near being finished, but the programming is (almost) done.
Currently, I have the basic program setup worked out, and I have a even more basic build design, I'm still working on that in my head. However, it's this particular aspect of the controller's joysticks that I need help programming.
My idea is to feed two motor's rotation vales (one on the left, one on the right) as the Joystick values, thus creating two Forward/Backward sticks, not a Throttle/Steering setup (ugh). I was planning on having it set up so that when the stick is pointing straight up, it's at the neutral position. Then, it could recognize forward and backward commands, on each stick. However, I wanted to ensure that the stick returned to the neutral position, so that if you pushed up on the stick and then let go, it would drop back down. This could easily be accomplished by springs, but if it was accomplished via programming, then you could apply it elsewhere. (Not to mention, the NXT doesn't come with springs.)
Currently I am attempting a setup where the Controller reads a motor's rotation value in degrees (as a variable), reduces it some, and then tells the motor to move the opposite direction with the variable going to the power input. This seems to be causing many problems, however. If anyone can help me, I would be delighted. I can send whatever I need to send to you (screenshots, program itself, etc.), just ask and you shall receive. (I would post it here, but I have no idea how.) Thanks in advance!
- Stryker