function Button(var port : byte; pin, time, active_state : byte) : byte;
Using Port A the function works perfectly when testing bits 0 and 1. However when I set the pin value to be anything greater than 1 the following code fails to work correctly.
This does not work. "SETUP MODE" is displayed when any bit on port a is high.
Code: Select all
if ( Button( PORTA, 2, 1, 1 ) = 255 ) then
Glcd_Write_Text( 'SETUP MODE ', 68, 7, 0 )
else
Glcd_Write_Text( ' ', 68, 7, 0 );
Code: Select all
if ( Button( PORTA, 0, 1, 1 ) = 255 ) then
Glcd_Write_Text( 'SETUP MODE ', 68, 7, 0 )
else
Glcd_Write_Text( ' ', 68, 7, 0 );
Code: Select all
if ( Button( PORTA, 1, 1, 1 ) = 255 ) then
Glcd_Write_Text( 'SETUP MODE ', 68, 7, 0 )
else
Glcd_Write_Text( ' ', 68, 7, 0 );