Re: My car
Posted: 18 Oct 2010, 17:48
What do you mean? Just expand the block, and there is a place to connect a RAW value wire.fuzzball27 wrote:...Is that with the advanced programming expansion pack?...
Give a child a robot, he'll play for an hour. Teach him to build, and he'll play forever.
https://mindboards.org:443/
What do you mean? Just expand the block, and there is a place to connect a RAW value wire.fuzzball27 wrote:...Is that with the advanced programming expansion pack?...
That is a great idea, but it's not quite what I'm trying to accomplish. I need a very quick response (as close to instant as in possible), for example when I am holding the thumbsticks all the way back, it’s driving backwards, but then I flip them all the way forward and make it pop a wheelie. Then, when I release the thumbsticks (which were in the “100% forwards†position), I want them to automatically center themselves (back to the 'neutral' position).You could have the levers as pedals with touch sensors which would speed the robot up gradually.
(Have the robot add power as the length of time that the touch sensor is held increases. Equation: s = seconds p = power; 10s=p
Example: The touch sensor is held down for 10 seconds. 10x10=100. Over a period of ten seconds the robot will be at 100 power)
-Ryan
I thought that the opposite was the case. According to Danny Benedettelli when reading raw values for the NXT touch sensor, the readings can be anywhere from 50-1000.Edit: Are you referring to the INability to detect pressure with the touch sensor? This is a mechanical limitation of the NXT touch sensor. The NXT Touch sensor either returns 0 (1023) or 1 (18x). The RCX touch sensor changes resistance with force applied. Unlike the NXT Touch sensor, the RCX Touch sensor is NOT a switch, but rather a variable resistor. The values range from ~55-1022* as being pressed, and 1023 and not being pressed.
Have you tried using variables? For example, you could assign a variable to each motor, record how many degrees you moved each motor using the variables, and when you push the orange button they center using the variables to know how far to go.I need a very quick response (as close to instant as in possible), for example when I am holding the thumbsticks all the way back, it’s driving backwards, but then I flip them all the way forward and make it pop a wheelie. Then, when I release the thumbsticks (which were in the “100% forwards†position), I want them to automatically center themselves (back to the 'neutral' position).
Tested it. I'm getting 200, 183, 180, 179, 181, and 1023 on the NXT touch sensor. I believe Danny and John Hanson were correct, although it is only sensitive in the low range.I guess Danny Benedettelli misspoke. I just tested it, and I KNOW that the NXT touch sensor doesn't have analog ability, and that the RCX touch sensor DOES. Try it yourself.
Code: Select all
task main() // the main (only) task
{
SetSensorTouch(S1); // initialize a sensor on the analog pin
SetSensorTouch(S2); // initialize a sensor on the analog pin
SetSensorTouch(S3); // initialize a sensor on the analog pin
SetSensorTouch(S4); // initialize a sensor on the analog pin
while (true) // repeat forever
{
Wait(50); // slow the program down a little
ClearScreen(); // clear the screen
SetSensorMode(S1,IN_MODE_BOOLEAN); // make the sensor be read in a true/ false manner
SetSensorMode(S2,IN_MODE_BOOLEAN); // make the sensor be read in a true/ false manner
SetSensorMode(S3,IN_MODE_BOOLEAN); // make the sensor be read in a true/ false manner
SetSensorMode(S4,IN_MODE_BOOLEAN); // make the sensor be read in a true/ false manner
Wait(1); // wait for the last step to take place fully
NumOut(0,LCD_LINE1,SENSOR_1); // display the boolean result
NumOut(24,LCD_LINE1,SENSOR_2); // display the boolean result
NumOut(48,LCD_LINE1,SENSOR_3); // display the boolean result
NumOut(72,LCD_LINE1,SENSOR_4); // display the boolean result
SetSensorMode(S1,IN_MODE_RAW); // scale from 1023 - 0
SetSensorMode(S2,IN_MODE_RAW); // scale from 1023 - 0
SetSensorMode(S3,IN_MODE_RAW); // scale from 1023 - 0
SetSensorMode(S4,IN_MODE_RAW); // scale from 1023 - 0
Wait(1); // wait for the last step to take place fully
NumOut(0,LCD_LINE2,SENSOR_1); // display the RAW result
NumOut(24,LCD_LINE2,SENSOR_2); // display the RAW result
NumOut(48,LCD_LINE2,SENSOR_3); // display the RAW result
NumOut(72,LCD_LINE2,SENSOR_4); // display the RAW result
}
}