ik ben bezig aan het programmeren van een basic stamp2.
wat ik niet helemaal begrijp is de instuktie "button"
kan iemand mij hiermee helpen?
dank.

Dat zal héél waarschijnlijk een ontdendering zijn. Als je gewoon op een knopje drukt, dan zal dat een aantal keren aan/uit wisselen, voor het de vaste toestand (ingedrukt) heeft, dat noemt men dender.
Die Button instructie zal er dan voor zorgen dat je een net signaal krijgt , ook al dendert de knop.

ja da wist ik ook, maar hoe werkt hij??
waarvoor dient downstate, en delay? rate en targetstate?
dank

ja, dat wist ik ook, maar hoe werkt hij? waarvoor dien rate, en downstate? en delay en targetstate?
toch bedankt

BUTTON Pin, DownState, Delay, Rate, Workspace, TargetState, Address

• Pin is a variable/constant/expression (0–15) that specifies the I/O pin to use. This pin will be set to input mode.

DownState is a variable/constant/expression (0 or 1) that specifies which logical state occurs when the button is pressed.

Delay is a variable/constant/expression (0 – 255) that specifies how long the button must be pressed before auto-repeat starts. The delay is measured in cycles of the Button routine. Delay has two special settings: 0 and 255. If Delay is 0, Button performs no debounce or auto-repeat. If Delay is 255, Button performs debounce, but no autorepeat.

Rate is a variable/constant/expression (0 – 255) that specifies the number of cycles between auto-repeats. The rate is expressed in cycles of the BUTTON routine.

Workspace is a byte variable used by BUTTON for workspace. It must be cleared to 0 before being used by BUTTON for the first time and should not be adjusted outside of the BUTTON command. NOTE: All RAM is cleared to 0 by default upon power-up or reset of the BASIC Stamp.

TargetState is a variable/constant/expression (0 or 1) that specifies which state the button should be in for a branch to occur. (0=not pressed, 1=pressed)

Address is a label that specifies where to branch if the button is in the target state.

Enige moeilijke dat ik zie is de instelling voor delay en rate, speel een beetje met die waarden tot je er tevreden mee bent. De rest is te begrijpen door iedereen die het wil begrijpen (imho).

Met Downstate geef je aan of de toets aan massa (downstate = 0) of aan de +5V (downstate = 1) is aangesloten.