Case1:
Before running: Touch LED status(Untouched)
Program Running: (1)Touching Touch LED: LED lights on and the color is green
(2) Untouch Touche LED: LED color turns red
Case2:
Before running: Touch LED status(touched)
Program Running:
(1)Untouch Touch LED: LED light keeps off instead of light on with Red color
(2)Continue touch and untouched Touch LED: In the first few seconds, Touch LED doesn’t work; after a few seconds, Touch LED works but it takes more strength (becomes insensitive ). But if we touch it with another part of our body (opisthenar for example) after taking the finger off, Touch LED works immediately without any delay. Besides that, we can make it with little strength.
You’ll need an answer from @jpearman for the details, but I’ll hazard a guess. There is a microprocessor in the touch LED, it’s sending touch/no touch messages to the brain, and receiving color messages from the brain. When you go to start the program, the sensor is busy sending Touched messages. These are sitting in a queue waiting to be processed. Program starts and it starts processing the messages. So what you are seeing is a delay as it catches up. Your hand swap takes a few seconds, and that gives it time to catch up.
Pressing harder isn’t the key, that’s your brain going “stupid machine, let me press harder to,get your attention”. ( Much as Americans when not being understood in a foreign country will say the same words but louder). If you repeat your experiment with the same light touch, you’ll see the same results.
Fixes are to not hold the sensor while you start the program. If you are trying to do an automous selector, remember the led will show lots of colors, use the touch / untouched as a way to cycle though them.
Good luck!
Oh and bonus points to you for a first post that was really well worded AND had the code with it. Nice job, welcome to the forum!
thanks very much for your detailed explaination .
unfortunately what @Foster describes is not entirely correct. The touch led does not send the touch information via the i2c bus, so there is nothing to queue, it actually uses a digital IO connection to communicate that, only color information is sent to the sensor. I’ll have a quick look tomorrow and see if I see that behavior in VEXcode, it may just be a bug in Modkit. The touch led is a capacitive sensor, check that it is working correctly by opening the devices screen on the IQ and using the diagnostics there.
I had a look into this and what you are experiencing is expected behavior.
When a program runs the sensor is reset (full disclosure, this does not happen in robotc due to how robotc works). When the touchled is reset it needs to measure a baseline for the capacitive touch sensor, if you are touching the sensor when it is reset then this “touch” value becomes the base line, that means that further touches will be mostly ignored.
the bottom line here is don’t touch the sensor when launching the program.
Thanks for the reply, I had figured that you had a CPU reading the bus to do colors, might as well send the touch back the same way. Guess that extra wire in the cable is handy.
And the capacitive touch makes sense, pushing it “harder” would get more surface to touch.
I would have thought at power up the brain would sweep the ports on power up to see what’s there, but this sounds like it’s more of program start time.
All good things to know, thanks!
The brain does do this, but one “feature” is that every time you run a program the IQ probes for new sensors in case they were plugged in after power on, that causes all sensors to be reset. Because robotc runs the VM and then keeps it running, you don’t see this behavior with a robotc program. robotc user programs are programs running within another program.
Does it also resample for motors? That’s a current issue that if the roboteers plug a motor in, the brain has to reboot to pick it up.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.