Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:51 13 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Just having simple fun

Author Message
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 600
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.

 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025