I cannot get the LCD Keypad Shield by D1ROBOT to work on my Arduino Clone Rev 3 with ATmega328p.
I would need a pointer on the connections with wires and a sketch to work with it.
Thanks
Arduino Uno Rev 3 Mega328p, windows 10 64 bit, I am yet no able to clearly understand the parameter for LiquidCrysta(). I can modify code since I did some C programing 27 years ago.
#include <LiquidCrystal.h>
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnNONE 5
// read the buttons
int read_LCD_buttons()
{
int adc_key_in = analogRead(0); // read the value from the sensor
// my buttons when read are centered at these values: 0, 144, 329, 504, 741
// we add approx 50 to those values and check to see if we are close
if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
if (adc_key_in < 50) return btnRIGHT;
if (adc_key_in < 195) return btnUP;
if (adc_key_in < 380) return btnDOWN;
if (adc_key_in < 555) return btnLEFT;
if (adc_key_in < 790) return btnSELECT;
return btnNONE; // when all others fail, return this...
}
Thank you John. I kind of down dealing with my inability to make that work.
I appreciate very much that fact you took the time to help. Thanks a million.
I was happy when I hooked up everything and testing blink. Uno. It did work!!!
Got ambitions and read more an decided to try to learn using the Serial monitor as my debugging tool for future and more complex code. Well, it did work but it seemed that I did not plant to include in the code privions to allow the COM port to be Fred up for future program loads. Mi nightmares started and the shield code could not be loaded. Even after passing that stage nothing I did works.
Will try your sugestión tomorrow nd again very many thanks for your support.
Wilson
PS my end goal is to write a code to sincronizar in a perfect integer ratio data from one rotating shaft with optical encoder with a rotating shaft controlled by the Arduino to maintain perfect( withing resins) according the ratio selected at the beginning of the program.
Thanks a lot. I just took a picture but not sure I know how to send it to you. I have an iPhone 6S but I am an old timer (83) and not very handy with cell phones. But I wil try right after this email.
The sample to detect the keys compiled and loads but nothing happen Powered by the USB A&B and 8 volts from wall adapter. Shiel gets full bright light but no action when pressing buttons after loading the compiled code.
Thanks
Copy the phone picture to the Pc in a place You can find it.
Old timer? That's only on the paper!
I was new here once and didn't know how to post both "this and that.
Being 69 now and "burned out" I still see white spots on the map.
I'm testing now... Clicked on the seventh symbol in this window, a base and an up arrow, and selected a picture of me (in my hobby room) and clicked okey, open, whatever it was.
I tried that link but ended up in a supermarket...
Copying, or glancing at, existing code is never wrong. Reading the code, modifying it and testing....... I've done that a lot being thrown into new, large, unknown systems.
Yes, thank you very much for you support.
I found out from another member that I was selecting the incorrect board with "Tools". SO I need to try again.
Thanks for your time, i could be based on age your dad. Now 83
I tried and failed past night and went to bed frustrated, but another member I think discover one of my mayor mistakes: I was selecting the board in the Tools of IDE as: ATmega328p plaine mini.
So I will now use Arduino Uno in my selection and find out.
You look cool, I could never keep a good looking bear like yours, too late now. Hair does not grow anymore (On my head).
Hope one day I can conquer this micro controller thing.........
Thanks a lot for your support,
Wilson
My apologies if I broke any rules. I must admit that even that I have been in many other forums for different subject I never thought I was infringing on anything serious or incorrect. No to sure sure I understand all jargon utilized in the rules you mentioned, I will try my best to comply.
Also maybe not a good excuse but I myself get confused very easily at my age and sometimes I do not know which way is up.
@sterretje
Sorry about my ignorance. I am not sure how to proceed now with the question I have. I am not really understanding where to port now.
I very much appreciate that someone in this forum woke me upvto my incorrect board selection error and I could advance.
For example: my original problem was I was selecting the incorrect board in IDE. I corrected that and I asked for plan B for me that could be just forget about creating my own sketch for the application I have; then since I have the HEX type file given to me I asked how to load it directly.
You answered and now as follow up I have another problem, Where do I post that?
Do I start a new topic? (I get an error for avrdude) continue with the post (Which I cannot recall).
Maybe just should I go someplace else with my questions?
I am not the brightest person, have some handicaps or weakness.
Please advise.
Thanks, Wilson
Confused