OK I found the proper pins of the switch.Your button is just like a switch, so see the interfacing techniques in Manual 3.
You need to check which contacts close when the switch is pressed with a multimeter...
if c.6 = high then
high 0,1,2,3,4,5,6,7
endif
Maximum input voltage is around Vdd + 0.3v so 3.6v at a 3.3v supply.1- What is the maximum voltage I can use for an input?
2- the following code does not compail (I am trying to check if c.6 is high then turn on some LED's)
Code:if c.6 = high then high 0,1,2,3,4,5,6,7 endif
pullup 2
Thanks.1. The supply voltage. (to be safe)
2.Code:if pinC.6 = 1 then ; ****** high 0,1,2,3,4,5,6,7 ;or ; OutpinsB = %11111111 ; perhaps? endif
Simply have:I am a bit confused. How can I do something that when I hold the button the LED be on and when I release it they turn off?
if pinC.6 = 1 then
pinsB = 255
else
pinsB = 0
end if
Probably won't have any effect on the rather slow PICAXE unless it's running at top speed or with poor quality switches, in which case a simple 'pause 20' will do.And, Manual 3, p. 27
Switch bounce
Thanks, this pullup was super helpful!ADDED: Since you're using a pin which supports internal pullups, you can wire the switch like this and save on a resistor:
You will need to use this at the beginning:and exchange any 'if pinC.6 = 1' with 'if pinC.6 = 0' and vice versa.Code:pullup 2
Thanks this works also.In a loop keep testing the state of the buttons:
Code:do if pinc.6=1 then high 0,1,2,3,4,5,6,7 else low 0,1,2,3,4,5,6,7 endif loop