Trouble shooting help

Recently acquired a book called Ham Radio for Arduino and Picaxe and have been trying to get a project going called Sweeper (an Arduino VSWR meter). When I first started I was getting a lot of errors which I have mostly solved thanks to the 'net but I am still getting one persistent error

C:\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:29: error: expected declaration before '}' token

Cannot solve this one, remember I am a newbie so be kind, even searching the net and I am confused :~. I am assuming that the problem lies with the LCD4Bit_mod.cpp file. I have edited the file to remove LCD4Bit_mod.h and replace with Arduino.h and removed extern "C" This solved most of the error messages but one still remains.

Can someone point me in the right direction?

Adrian

No the problem is that you have missed some braces.
Read the how to use this forum sticky post then post the code you are having trouble with.

Can someone point me in the right direction?

Not without seeing your code.

But just have a real good look for the missing brace, it could be way before line 29. If your code it indented correctly it should be pretty obvious what's missing.


Rob

Been unable to post the code due to size restrictions exceeded 9500 characters :astonished:
Will look for missing {,}
Adrian

You can attach a file.

Anyway the error has to be before line 29 or in a header file.


Rob

Here is the file. This is not my file I have taken it from the authors website.

Adrian

Sweeper.ino (9.86 KB)

And the hacked header file?

In the Arduino IDE editor, if you place the cursor immediately after an opening or closing brace, the editor "boxes" the matching opening or closing brace in the source file. That makes it pretty easy to locate brace mismatches.

I don't think there are any mismatched braces in the code posted - I think the problem lies in the header file, which hasn't been posted.

I have trouble shooting help, too. Good help is too hard to find.

Sounds like a problem Leona Helmsley would have had. 8^)

The files have arrived

LCD4Bit_mod.h (622 Bytes)

LCD4Bit_mod.cpp (7.44 KB)

#include "LCD4Bit_mod.h" {
#include <stdio.h> //not needed yet
#include <string.h> //needed for strlen()
#include <inttypes.h>
#include <arduino.h> //all thiArduino.hngs wiring / arduino
}

No no no, either comment out the unused lines or use an #if 0 block

#include "LCD4Bit_mod.h" 
#if 0
  #include <stdio.h>  //not needed yet
  #include <string.h> //needed for strlen()
  #include <inttypes.h>
  #include <arduino.h>  //all thiArduino.hngs wiring / arduino
#endif

Rob

Thanks Rob tried that and it created more errors.

Adrian

and it created more errors.

...and I can't be bothered to post the code or the errors.

Here are the errors.

C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:61: error: declaration of 'void LCD4Bit_mod::pulseEnablePin()' outside of class is not definition
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:62: error: expected unqualified-id before '{' token
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:78: error: expected unqualified-id before 'for'
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:78: error: expected constructor, destructor, or type conversion before '<=' token
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:78: error: expected constructor, destructor, or type conversion before '++' token
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:81: error: expected constructor, destructor, or type conversion before '>>=' token
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:82: error: expected constructor, destructor, or type conversion before ';' token
C:\Users\Adrian\Downloads\arduino-1.0.5-windows\arduino-1.0.5\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:83: error: expected declaration before '}' token

Looks like a typo in the cpp file:

void LCD4Bit_mod::pulseEnablePin(); {

remove the ;

void LCD4Bit_mod::pulseEnablePin() {

.. a few of small "bugs" there - enclosed a rar with source which builds for uno..
not tested no warranties of any kind..

Sweeper.rar (6.86 KB)

Pito thanks for the file will test and let you know

Adrian

Pito these are the error messages I now get.
Started getting very frustrated with Arduino. Had to reinstall IDE this morning couldn't compile anything at all including the simple Blink sketch.
I have tried using the Win Installer and all I get after install is a flashing screen, if I download the file and install I cant import libraries. I tried to download the Beta 1.5 and it gets as far as 60-90% and then error message Cant download file.

Adrian

C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:29:57: error: WConstants.h: No such file or directory
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pulseEnablePin()':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:58: error: 'LOW' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:58: error: 'digitalWrite' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:59: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:61: error: 'HIGH' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:64: error: 'delay' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pushNibble(int)':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:73: error: 'digitalWrite' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWriteNibble(int)':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:99: error: 'LOW' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:99: error: 'digitalWrite' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWrite(int)':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:106: error: 'LOW' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:106: error: 'digitalWrite' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::print(int)':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:118: error: 'HIGH' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:118: error: 'digitalWrite' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:119: error: 'LOW' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::clear()':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:139: error: 'delay' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::init()':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:146: error: 'OUTPUT' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:146: error: 'pinMode' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:154: error: 'delay' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:160: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::leftScroll(int, int)':
C:\Users\Adrian\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:225: error: 'delay' was not declared in this scope