| Posted: 05:12pm 22 Jun 2019 |
Copy link to clipboard |
 Print this post |
|
Was trying to get a bit more from the 28 pinner. I needed a bipolar led an a button. So took the led and added the button.
 and to test the idea.
Do Print "Off Red Green Button" Input "O,R,G,B ";k$ Select Case k$
Case "o","O" off
Case "r","R" red
Case "g","G" green
Case "b","B" button Print "Button = ";b
End Select Loop
Sub off SetPin 24,din SetPin 26,din End Sub
Sub red Pin(26)=0 Pin(24)=1 SetPin 26,dout SetPin 24,dout End Sub
Sub green Pin(26)=1 Pin(24)=0 SetPin 26,dout SetPin 24,dout End Sub
Sub button Local p24,p26 p24=Pin(24) p26=Pin(26) Pin(24)=0 SetPin 24,dout SetPin 26,din,pullup b = Pin(26) SetPin 26,dout Pin(24)=p24 Pin(26)=p26 End Sub
Loop
nice on how far and easy MMBasic lets us push this little one.
|