Go Down

Topic: LCD menu with encoder (Read 1 time) previous topic - next topic

#30
Aug 14, 2018, 03:38 pm Last Edit: Aug 14, 2018, 03:41 pm by adamaero
Line 13, the line that is generating the error is NOT in a function. It MUST be.
In the REBLDisplay.h file, I forgot to put in "void", but I changed that, and have the same error message.

#31
Aug 14, 2018, 03:44 pm Last Edit: Aug 14, 2018, 03:45 pm by adamaero
REBLDisplay.h

Code: [Select]

#ifndef REBLDisplay_h
#define REBLDisplay_h

#include "Arduino.h"
#include "LiquidCrystal.h"
#include "Defines.h"

enum color_vars {BLACK, RED , GREEN , YELLOW , BLUE , PURPLE , CYAN , WHITE};



void initLCD(LCD_RS_PIN, LCD_ENABLE_PIN, LCD_D1, LCD_D2, LCD_D3, LCD_D4); // New
void doBacklight();
void setColor(color_vars);
void doDisplay();
void displayTextLeft(int, int, int, const char*);
void displayTextLeft(int, int, int, const __FlashStringHelper*);
void displayTextRight(int, int, int, const char*);
void displayLineLeft(int ,const char* );
void displayLineLeft(int ,const __FlashStringHelper* );
void displayLineRight(int ,const char* );
void displayLabelAndValue(int ,const char* ,int);
void doCursor();
void setCursor(uint8_t, uint8_t);
void showCursor(boolean);





#endif


Shouldn't line 25 be changed from "void setCursor(uint8_t, uint8_t);" to something else?

PaulS

In the REBLDisplay.h file, I forgot to put in "void", but I changed that, and have the same error message.
I'm hunting for a picture of the answer.

You could post your code PROPERLY, in code tags, AS TEXT, and then I wouldn't need to find a picture of the answer, and you could make some real progress a lot faster.
The art of getting good answers lies in asking good questions.

econjack

Shouldn't line 25 be changed from "void setCursor(uint8_t, uint8_t);" to something else?
Why? This file has what are called function prototypes. Their purpose is to tell the compiler:

1) the data type that this function returns (e.g., int, char, long, etc.). If the function returns nothing, the return tpe is void. This is called the function type specifier.

2. the function name, or ID.

3. the type of data being passed to the function. For setCursor(), there are two pieces of data passed in--row and column. These are called function parameters. A function may have zero (a void parameter list) to many function parameters.

Collectively, these three items form the function signature for the function. If you add a semicolon at the end of the function signature, you get a function prototype. The function prototype allows the compiler to perform type checking on the function type specifier, the function's parameter list, for the named function. Function type checking can help insure that you pass the correct information to the function and that you use the return value (if any) correctly.

#34
Aug 14, 2018, 04:23 pm Last Edit: Aug 14, 2018, 04:25 pm by adamaero
I'm hunting for a picture of the answer.
Do you get emails? Is that why you do not see the post right above that?
Is there a way to show the difference between two scripts side by side on here? I didn't think so, but if there is that would be good to know.

PaulS

You don't seem to understand that one can not compile a header file by itself.
You don't seem to understand the concept of POST ALL OF YOUR CODE.

Until you do, I am just wasting my time.

Moving on...
The art of getting good answers lies in asking good questions.

#36
Aug 14, 2018, 04:30 pm Last Edit: Aug 16, 2018, 03:30 pm by adamaero
@Delta_G: What is the heart beat pin?

#define HEART_BEAT_PIN A5


#37
Aug 14, 2018, 04:48 pm Last Edit: Aug 16, 2018, 03:23 pm by adamaero
You don't seem to understand that one can not compile a header file by itself.
You don't seem to understand the concept of POST ALL OF YOUR CODE.
I thought uint8_t was for the 8-bit LCD screen. (Forgot it's basically unsigned char.) Anyway, here's everything attached. (I cannot post the code directly because it is too much for the min. characters.)

Edit: it works now. The attached files do not.

Delta_G

Heartbeat pin is just a pin with an led that blinks to let me know the program is running.  I have that in almost every project I do. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

odometer

Heartbeat pin is just a pin with an led that blinks to let me know the program is running.  I have that in almost every project I do. 
What sort of experience have you had that you feel it is worth the trouble to have such a thing?

#40
Aug 14, 2018, 11:05 pm Last Edit: Aug 14, 2018, 11:05 pm by adamaero
I thought it was so close to working. But I'm burnt out. I give up.
~ Even paid someone from UpWork to help.  :smiley-cry:

Delta_G

What sort of experience have you had that you feel it is worth the trouble to have such a thing?
It's no trouble.  It's just nice when debugging.  You think it locked up because it quit outputting to serial or doing whatever.  Blinky light lets you know if the program is still turning over or not. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

odometer

It's no trouble.  It's just nice when debugging.  You think it locked up because it quit outputting to serial or doing whatever.  Blinky light lets you know if the program is still turning over or not. 
I don't understand. If the program didn't lock up, then why would it have quit "outputting to Serial or doing whatever"?

Delta_G

I don't understand. If the program didn't lock up, then why would it have quit "outputting to Serial or doing whatever"?
Maybe it got stuck in some infinite loop or some corner case.  Maybe the wire got cut.  Or maybe the whole program got blanked.  Or maybe it got hit with ESD and it's all wonky now.  Maybe the problem is on the other end.  Or maybe I just like to see a light blink so I can look from across a room and see that my project is on and running. 

Seriously, what is it to you?  If you don't like blinky lights then don't put them on your project. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

#44
Aug 16, 2018, 03:44 pm Last Edit: Aug 16, 2018, 03:50 pm by adamaero
So I changed Defines.h:
Code: [Select]
#define NUM_LCD_ROWS 4
#define NUM_LCD_COLS 20

...but the menu options only fill half the screen (2x20 instead of 4x20). I guess it's OK to have one option at a time.

github.com/adamaero/REBL_UI
(I can attach the scripts if someone wants.)

Go Up