Touch Sensor "Raw" value
Touch Sensor "Raw" value
Hello everyone!
So...the touch sensor has a data plug for the raw value of the touch sensor. I tried using it to create a variable touch sensor (pressure switch), but it only read two numbers. Is there a way to use the raw value to create a "pressure switch"? If not, why is the raw value there???
jojoguy10
So...the touch sensor has a data plug for the raw value of the touch sensor. I tried using it to create a variable touch sensor (pressure switch), but it only read two numbers. Is there a way to use the raw value to create a "pressure switch"? If not, why is the raw value there???
jojoguy10
Re: Touch Sensor "Raw" value
All analogue sensors have a raw value, as does the touch switch. It's just that when the touch switch closes, you'll create a short circuit, so the analogue value will be "0". When it is open, it will read "1023". There's no in between though, so it's not like a pressure gauge.
- Xander
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: Touch Sensor "Raw" value
Well... actually it is not a dead short, there is a 2.2k ohm resistor in series with the switch to protect it. So, since the input has a 10k ohm pull-up resistor, the raw value with closed switch is around 1023*22/122=184mightor wrote:All analogue sensors have a raw value, as does the touch switch. It's just that when the touch switch closes, you'll create a short circuit, so the analogue value will be "0"
Philo
Re: Touch Sensor "Raw" value
no "internal resistance" between the contacts, depending on how tight you press it?
Maybe the values are faked by the firmware, and if you want to read the "real raw values" - : what about configuring it as a "general analog sensor"?
edit... philoo was faster :(
Maybe the values are faked by the firmware, and if you want to read the "real raw values" - : what about configuring it as a "general analog sensor"?
edit... philoo was faster :(
Re: Touch Sensor "Raw" value
I stand corrected
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: Touch Sensor "Raw" value
Since it is just a switch with a resistor in line (to limit the current drawn from the port) you are only ever going to get on or off, even if 'on' is not quite a dead short.
I did see a website once where someone had connected a set of switches in parallel into one port, each switch with a different value of resistor. By defining it as one of the analogue sensors he was able to read the various resistances so he knew which switch was pressed.
Saved having to use a separate microchip for multiplexing.
I did see a website once where someone had connected a set of switches in parallel into one port, each switch with a different value of resistor. By defining it as one of the analogue sensors he was able to read the various resistances so he knew which switch was pressed.
Saved having to use a separate microchip for multiplexing.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Re: Touch Sensor "Raw" value
This is also how the HiTechnic Touch MUX and the Mindsensors Touch MUX work. It's a resistor network in both cases.
- Xander
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: Touch Sensor "Raw" value
that blows me away!
Could that mean, if I'm using RCX Touch sensors instead of the NXT ones (having different internal resistors), that the returned values could be distorted?
(actually i intended to use RCX or 3rd company hardware switches for my robot project)
Could that mean, if I'm using RCX Touch sensors instead of the NXT ones (having different internal resistors), that the returned values could be distorted?
(actually i intended to use RCX or 3rd company hardware switches for my robot project)
Last edited by HaWe on 25 Feb 2011, 21:33, edited 2 times in total.
Re: Touch Sensor "Raw" value
I don't have those but I'd say so
A whole new world has just opened up for you, has it?
- Xander
A whole new world has just opened up for you, has it?
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: Touch Sensor "Raw" value
no: no new world has opend - a world threatens to sink
Who is online
Users browsing this forum: Semrush [Bot] and 0 guests