Help with shields.

Gonçalo

Member
i have bougth another shield cause i thougth the other was mking bad contact but its the same. i have a smal program wich i have 6 inputs since sensors to buttons.everytime i press one button the others ligth up. no bad contact, even if i takke everyting out and just put a wire with a 10k to the ground everything just ligths up. and that has been ruining my project for days. i need help please. it never happened to my friends.
 

hippy

Technical Support
Staff member
Hi Gonçalo,

If you can post details of which shield you have, which PICAXE you are using, and what your program is; that may help people to better advise you.

It sounds like you may have the inputs floating, so pushing one button causes other inputs to be seen as high inputs.
 

hippy

Technical Support
Staff member
Normally every input pin would have a separate 10K resistor to 0V (GND) added to hold it in a low state until a push button to +V brings it to a high state. These are known as pull-down resistors.

If a pull-down resistor is not fitted on an input the input is neither held in a low nor high state so is considered 'floating' and it may be influenced by other inputs.
 

hippy

Technical Support
Staff member
You probably need to post your program and a photo of what you have would help.
 

Gonçalo

Member
main:
let dirsA = 16
let dirsB = 255
let dirsC = 0

Cell_4_4:
serout B.7, N4800, (254, 128, "COLOCAR BAG | ")
serout B.7, N4800, (254, 192, "EM POSICAO V ")

Cell_7_4:
if pinC.1=1 then

goto Cell_7_6
end if
goto Cell_7_4

Cell_7_6:
let varA = 0
let varB = 0
let varC = 0
Cell_7_10:
if pinC.3 = 1 then
goto Cell_10_10
end if
if pinC.4 = 1 then
goto Cell_10_17
end if
if pinC.5 = 1 then
goto Cell_10_24
end if
if pinC.6 = 1 then
goto Cell_10_31
end if
serout B.7, N4800, (254, 128, "SELECIONAR QUANT")
serout B.7, N4800, (254, 128, " 5L 10L 15L 20L ")

goto Cell_7_10

Cell_10_31:
high B.5
pause 1000
Cell_13_31:
if pinC.2 = 1 then
goto Cell_16_31
end if
pause 5000
Cell_13_28:
serout B.7, N4800, (254, 128, "Se erro corrigido")
serout B.7, N4800, (254, 128, "Prima botao 20L ")

if pinC.6 = 1 then
goto Cell_13_31
end if
goto Cell_13_28

Cell_16_31:
high B.4
pause 2000
low B.4
let varH = 150
let varI = 20
Cell_22_6:
high B.6
high B.3
if pinC.0 = 1 then
goto Cell_25_2
end if
goto Cell_22_6

Cell_25_2:
pause 0
let varA = varA + 1
if varA = 2 then
goto Cell_28_7
end if
Cell_25_13:
if pinC.7 = 1 then
goto Cell_28_13
end if
if varB = 30 then
goto Cell_28_16
end if
Cell_25_23:
if varC = varH then
goto Cell_28_23
end if
let varG = varC / 3
bintoascii varG, varTEMPBYTE1, varTEMPBYTE2, varTEMPBYTE3
serout B.7, N4800, (254, 128, "A ENCHER -> ", varTEMPBYTE1,varTEMPBYTE2,varTEMPBYTE3,"L")
bintoascii varI, varTEMPBYTE1, varTEMPBYTE2, varTEMPBYTE3
serout B.7, N4800, (254, 192, "SELEC BAG ", varTEMPBYTE1,varTEMPBYTE2,varTEMPBYTE3,"L ")

goto Cell_22_6

Cell_28_23:
low B.6
low B.3
pause 2000
low B.5
let varA = 0
let varB = 0
let varC = 0
let varH = 0
let varG = 0
Cell_28_35:
if pinC.1 = 1 then
goto Cell_28_37
end if
goto Cell_4_4

Cell_28_37:
serout B.7, N4800, (254, 128, " CICLO COMPLETO ")
serout B.7, N4800, (254, 128, " RETIRAR BAG ")

goto Cell_28_35

Cell_28_16:
let varB = 0
let varC = varC + 1
goto Cell_25_23

Cell_28_13:
stop
Cell_28_7:
let varA = 0
let varB = varB + 1
goto Cell_25_13

Cell_10_24:
high B.5
pause 1000
Cell_13_24:
if pinC.2 = 1 then
goto Cell_16_24
end if
serout B.7, N4800, (254, 128, "Erro Torre ")
serout B.7, N4800, (254, 128, "Verifique posicao")

pause 5000
Cell_13_21:
serout B.7, N4800, (254, 128, "Se erro corrigido")
serout B.7, N4800, (254, 128, "Prima botao 10L ")

if pinC.5 = 1 then
goto Cell_13_24
end if
goto Cell_13_21

Cell_16_24:
high B.4
pause 2000
low B.4
let varH = 75
let varI = 10
goto Cell_22_6

Cell_10_17:
high B.5
pause 1000
Cell_13_17:
if pinC.2 = 1 then
goto Cell_16_17
end if
serout B.7, N4800, (254, 128, "Erro Torre ")
serout B.7, N4800, (254, 128, "Verifique posicao")

pause 5000
Cell_13_14:
serout B.7, N4800, (254, 128, "Se erro corrigido")
serout B.7, N4800, (254, 128, "Prima botao de 5L ")

if pinC.4 = 1 then
goto Cell_13_17
end if
goto Cell_13_14

Cell_16_17:
high B.4
pause 2000
low B.4
let varH = 38
let varI = 5
goto Cell_22_6

Cell_10_10:
high B.5
pause 1000
Cell_13_10:
if pinC.2 = 1 then
goto Cell_16_10
end if
serout B.7, N4800, (254, 128, "Erro Torre ")
serout B.7, N4800, (254, 128, "Verifique posicao")

pause 5000
Cell_13_7:
serout B.7, N4800, (254, 128, "Se erro corrigido")
serout B.7, N4800, (254, 128, "Prima botao de 3L ")

if pinC.3 = 1 then
goto Cell_13_10
end if
goto Cell_13_7

Cell_16_10:
high B.4
pause 2000
low B.4
let varH = 1
let varI = 3
goto Cell_22_6
 

hippy

Technical Support
Staff member
The issue with the LCD is perhaps in using an N4800 baud rate. Normally that would be expected to be N2400.

Some of the LCD 'SEROUT' commands will also be immediately overwriting previous LCD output lines - the second lines may not be correctly set to output on the lines they are meant to.

It would also be recommended to have a 'PAUSE' at the start of the program to let the LCD initialise before sending to it.

Your program is a little complicated which makes it difficult for others to follow. It may be best to start with a simpler program to get inputs and outputs working or perhaps run it through simulation to determine what the issue may be.
 

Gonçalo

Member
The issue with the LCD is perhaps in using an N4800 baud rate. Normally that would be expected to be N2400.
i dont know what is baud but i assume it is the actualization rate??

Some of the LCD 'SEROUT' commands will also be immediately overwriting previous LCD output lines - the second lines may not be correctly set to output on the lines they are meant to.
in older program works fine. only in the recent wont work. tomorrow i'll try with a N2400 baud rate

It would also be recommended to have a 'PAUSE' at the start of the program to let the LCD initialise before sending to it.
i have. i remove when trying to figure it out the problem.

Your program is a little complicated which makes it difficult for others to follow. It may be best to start with a simpler program to get inputs and outputs working or perhaps run it through simulation to determine what the issue may be.
i have done easier programs. in simulation. still happpen the same.
 

Gonçalo

Member
ok i'll make a simpler problem. But still, i know the program is not the problem and yes the shield. i have lots of floating point. when a put a signal in input 2, input 3 4 and 5 ligth up too. some dont do anything other do.
 

rossko57

Senior Member
Language is a problem, but we will get there :)

It is not clear, do you have the problem in simulation ? I thought that is what you meant, but perhaps not.

It really still sounds like floating inputs. Do you think that there may be a wiring error, so that your 10k resistors are joining all the inputs together, but not joined to ground (earth) (zero volts)
 

Gonçalo

Member
its everything connected fine. actually now i almost had it working fine but while much less it still does the same. so im restructuring the circuit. when i try again i'll give notice. :D thanks everyone.
 

Gonçalo

Member
so. i've bougth a breadboard to make the simulations outside the shield and it solved my problem. there was a small coding problem wich used a pin i dont use and dont have a pulldown resistor. i didi that for testing. now everything is working just perfect. the baud rate solved the lcd problem too. Thanks everyone
 
Top