
Programming your robot with sensor inputs
(First, i'm very sorry for not being a native speaker. I hope you can understand me anyway).
Hello, do you know if there is any good NXT/RCX programs in which you can "program" your own robot inside the program using sensors?
I played around with the rotation sensor, and i quickly figured out that it could be used for quick input. I'm currently doing a program in which you can input commands to the robot using the rotation sensor and a touch sensor (or whatever sensors you'd like to use), the commands is then saved as an array which is then read, and the robot does the things you just ordered it to do. I suppose there's much to learn about this fun (but still simple) way of programming a robot in the robots own program
Currently, the inputs is really simple. When you start the program on the RCX/NXT, the value of the rotation sensor is displayed on the display. To program something, let's say "Set MotorC to 100 power", you turn the rotation sensor to the code for that, in this case 6, then you press the touch sensor. Then you continue until your code is finished, and when you're done, you select 0 as an input to stop inputing and to start the robot's program.
It's really simple, but you can still do some sweet stuff with it
In the next version, i'm thinking of adding variables to it, where you first select your command, then you input a number.
Something like this, a quick program that is made with 16 inputs:
1 set M1 to > 100
2 set motorA and motorB to variable > 1
3 subtract one from variable > 1
4 wait INPUT ms > 20
5 if INPUT variable is 0, +2 orders > 1
6 move INPUT orders forward/backward > -4
7 play bip nr INPUT > 1
8 end of program, restart y/n > 1
I don't know if it's hard to understand, but basically, the robot starts moving at 100 speed forward, then it decreases it's speed to 0 over a 2 second period, then it repeats that until the battery is drained
I'd love to know how i can make a more fun way of programming the robot without a computer
