LCD with LED

Hello, I am new to Arduino code and was wondering what code I need to make a led light up through a digital pin connected to a push button and I want it to read on a 16x2 LCD screen when the led is ON or OFF. Very simple when I press the pushbutton with a pulldown resistor I want it to read out on the LCD. what code would I need for this? thanks

The Arduino IDE has code examples of using each of the devices you mention. Get each example to work and you will learn how each device works with it's own code. Then you will see how to combine the LED and switch. Finally, there are example for the LCD. Get that to work and then add code for the switch to show a status on the LCD. Have fun!

Paul

I have attempted with failure. if i could just see an example that way i can get an idea of how the code gets linked together.

tjones9163:
I have attempted with failure. if i could just see an example that way i can get an idea of how the code gets linked together.

You don't "link" the codes together - ever. You start with one program, say the sample that works with the switch. Then from the LED program add the line of code that defines the pin that is connected to the LED. Then from the LED program, pick the line or two that sets the LED pin HIGH and the line that sets the LED pin low and add them to the program. Test it. IF you can't see the LED go on and off after the switch is pressed, add a delay after the LED is turned on.

Paul

Thanks for the response. so no one knows the code to make this work?

tjones9163:
Thanks for the response. so no one knows the code to make this work?

Of course they do. You need to learn how to write it, also. Show us what you have tried and we will help you learn how to make it play.

Paul

Off topic:

Paul and tjones9163 aka Nighthawk 9000 aka TJ, you both have large amounts of spiel on the left side, why ?

Paul, have you not checked the link you provide for you website, as it appears you have it set wrong?

tjones9163 aka Nighthawk 9000 aka TJ, well, I guess name is not Nighthawk and I doubt anyone really is interested to know you are practicing for a few hours each day.

Maybe you would be willing to address what you have written in your left hand pane section ?


Paul - VK7KPA

I was not aware there was a limit.

The link problem is the forum's problem. They prefix the URL with "arduino.cc/".

Paul

Relax :slight_smile:
I am new to electronics and was just having fun with my left pane section. some people on here need to not take things so serious lol.

I have seen in the past, the Mods take issue with long spiels.

Paul. look at my link, it works fine, maybe you can find a way to make yours work too ?

Me, relaxed, totally, in the sun, casually sorting through lots of electronics stuff I have out in the back shed, deciding what is to be given away to my local ham radio club. :slight_smile:


Paul - VK7KPA

Hi, Paul.
Two years ago I made up 64 grab bags for the Pacific Northwest VHF Society conference. 15+years collection from the business. Several times I have cleaned my personal collection. Saturday I drove to a swap meet about 100 miles away and bought absolutely nothing! My last time!

Have you tried FT8?
73, Paul, KD7HB

Hi Paul,

Sounds like you had more nice stuff than I have had, nice.
I know it can be hard to resist buying at swap meets, especially things that sparkle with LEDs and have knobs, you did well. :slight_smile:

No, I haven't tried FT8, I'll have a look.
I have my HF wires down while I have the excavator in the bush doing clearing, but can't wait to set it up again.
I assist with the local repeater gear, since I live on the mountain just beneath the summit where we have our repeater site hut crammed with all sorts of VHF and UHF, including DMR and other digital modes.
Local club site: http://www.vk7taz.net/

The weekend was busy with JOTA/JOTI.

I was thinking on the code for OP, it wouldn't take a lot to come up with what he wants, but as you say, it does take away the joy of learning. If he can come back with the code he has, then as you say, we are in a better position to help.

Maybe we can make contact on HF or DMR someday ?


Paul - VK7KPA

Probably have had much more time than you have. I will be 78 next month.

Paul

Maybe you have, oui :astonished:
I read your web site, interesting, and I find that fantastic that at 78 years young you are active and engaged with micro-controllers, keep it up.


Paul - VK7KPA