Forgot to mention, there was another way with the existing code to probably fake out the FSR code. That is to use the VS voltage as input to the pin.
You would need to setup a jumper for the VS voltages.
If you look at the Image from the BB2 manua(lynxmotion.com/images/html/build151.htm)l:
At the area marked #8 and insert the jumper for VS(AX0), this will give us a voltage of 1/4 of VS. Which assuming is about 6V will be in the area of 1.5V. The Analog to Digital conversion should give you a number near 307. Probably a bit higher with full charge. So then in the config file if you hack the value:
cMandibleContact con 40 ;readings lower than this means that the mandibles/gripers probably don't touch anything
And maybe try a value like 400 here, it probably will never trigger…
Just a thought. But then again the files I uploaded are probably a better solution.
Wow!
So 2 possible ways to resolve the mandibles ‘no sensor’ problem.
One ( maybe the simply one) putting the VL jumper and modifying the value of cmandibleContact
The second ( the best ) is to upload ur modified code…but if it works i need to change other things in the code,right?
If the code I uploaded works, it works… That is, if the pin is not defined, more or less all of the code associated with it is removed. It simply adds 5 when you press one button and removes 5 if you push the other…
After have fixed same problem ( code and voltage ) mandible continues to give me problems!
Following mandibles tables i put a 10k resistor and sold it to fsr sensor…connected to bb2 at ax0 pin but when i turn on the bot i can’t controll it…it stay stopped continuing to beeping
(3 tones…pause …1 tone)
What i wrong?
Ps:
If i don’t connect the fsr sensor, and also the jumper in the pin ax1 i can control the bot without problem ,excluding the mandibles that i can only open,after do it the stay open…
You soldered a resistor to the FSR and connected it up to BB2 AX0(P16) and now the robot does not run? Does it run if you disconnect it? If so probably an issue on how you connected it… Maybe a short?
What did you do to the code? Did you turn this on: ;cTurnOffVol
If so try recommenting it back out and see if it works… Have you checked to make sure that your battery is charged?
When you messed with connecting up the FSR, you may have knocked wires off… So check your connection. See for example that all of the wires connecting up the PS2 receiver are plugged in. Likewise does it look like it is working???
Sorry if i hurted samebody,I only wanted to make my apod complitely funtional:-(
1- i soldered the resistor ( it is 1/4 or 1/8 of watt ? ) …i sold the red wire to one of the 2 ends of fsr sensor, yellow and black ( this with the resistor ) to the other end…like in the tables.
When i connect it the robot doesn’t run…it starts to make the same beeps…without it it works like always: without mandibles control.
I leaved the code with cTurnOff turned off…end no jump in P17.
Batteries all changed and all PS2 connections seams to be good…
At that point i can only think that can be 2 reasons:
The resistor not work…or I have to change same about the mansible contact value in cfg file…
What do u think about?
No problem, just trying to say that some days myself and others may be off doing something else…
Lets double check your FSR hookup. In particular it should look like:
That is the Red (+5V), make sure the power jumper for pins 16-19(AX0-3) is set to +5V is soldered to one side of the FSR.
The other side of the FSR is soldered to the Yellow (signal) wire and to one side of a 10K resistor, the black (ground)is soldered to the other side of the resistor.
Do you have a multi-meter? If so you can double check that the resistence between the yellow and black is 10K. Likewise to the Red pin should be > 10K. The resistance between Red and Yellow will change if you put pressure on the FSR… My guess is you have a short in this…
I have soldered the wires at the frs sensor in this way!
the resistor is 10K and 1/4 of watt.
the jumper that give power to 16-19 pins is correctly setted at 5v.
all seams to be like in the tables…( I only haven’t the jumper on 17 pin,I have removed this function from the program)but …
the problem continues!
I can’t control mandibles ( only open)…maybe the sensor doesn’t work!
this is a picture of the fsr connection,don’t look the weldings ,is just a provisionally work…
maybe I wrong samewhere…
If it were me, I would be checking it out with a real simple program. Something like:
val var word
valPrev var word
Loop:
adin 16, val
if val <> valPrev then
valPrev = val
serout s_out, i9600, [dec val, 13]
endif
pause 250
goto loop
This is typed on the fly and I may have not gotten it 100% correct, but probably close. Then run the program with output. What are the values when nothing is touching the sensor. What are the values when you press your finger onto the FSR? …
Thanx again Kurte,
I think that will be the way for to test the sensor.
Even if, before to reprogram the atom, I want to do the last tests trying to change the resistor ( i have to buy it).
But I ask to myself a thing:
If I use the same resistor…same fsr sensor…same configuration…and same program,
And if none has my same problem,
the logic consideration is that I wrong samewhere!
Until we know the range of values coming in, it is hard to know if the logic is off. It would help to verify if we are set up for the 0-1023 or the 1023-0 type configuration… Actually the high/low values will depend on how the resistors are sized… But that is more or less the idea.
I just tried again to connect the sensor but this time removing the jumper that gives pover to 16/19 pins.
Now seams that I can control the opening and closure of mandibles!!
Now I can close the mandibles but they don’t stop when I apply pressure to the sensor
Again as expected, the program is allowing the mandibles to close when the AdIN value is < some value. No power to the sensor, will most likely return 0 volts, which again ain’t telling us much…
Ok kurte!
In the next day I will buy a digital multimeter for to check values of resistor and sensor,
I hope that will give us the possibility to understand where is the problem:-)