Assigning Input pins to Variables
Archiver
Posts: 46,084
>
> > The Stamp does not have an IN(x) function for reading
> > a single input directly based on a variable I/O pin,
> > so let's create the function. Taking your convention
> > of numbering AUXIO pins on the BS2p40 as 16 to 31,
> >
***************************************************
I regularly use the following to read an Input pin.
'Variable Declarations
go_button var IN1
stop_button var IN2
'Program Code
If go_button = 1 then x_label
If stop_button = 1 the y_label
Perhaps this will help in coding.
Ron
> > The Stamp does not have an IN(x) function for reading
> > a single input directly based on a variable I/O pin,
> > so let's create the function. Taking your convention
> > of numbering AUXIO pins on the BS2p40 as 16 to 31,
> >
***************************************************
I regularly use the following to read an Input pin.
'Variable Declarations
go_button var IN1
stop_button var IN2
'Program Code
If go_button = 1 then x_label
If stop_button = 1 the y_label
Perhaps this will help in coding.
Ron