Problem with LocoNet library

Hello,

then uploading the LocoNetMonitor example to my Uno, I get the following error messages:

C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp: In function 'void __vector_11()':
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:116: error: 'PB0' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:128: error: 'PB0' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:142: error: 'PD6' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:142: error: 'PB0' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:190: error: 'PD6' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:195: error: 'PD6' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp: In function 'void initLocoNetHardware(LnBuf*)':
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:227: error: 'PB0' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:230: error: 'PD6' was not declared in this scope
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp: In function 'LN_STATUS sendLocoNetPacketTry(lnMsg*, unsigned char)':
C:\Program Files\Arduino IDE\arduino-0022\arduino-0022\libraries\LocoNet\utility\ln_sw_uart.cpp:319: error: 'PD6' was not declared in this scope


Why?

JanD

the missing things PB0 etc are defined in - ln_config.h (in the loconet/utility dir) - so you need to include that one somewhere in your code.

ln_config.h IS included on the top of the ln_sw_uart.cpp file.

JanD

Yes there is a line but the file is not included obviously, probably because path to the .h file is missing.

• try: change #include "ln_config.h" to #include "utility\ln_config.h"
• maybe same for #include "ln_sw_uart.h"

Rob

That didn't help. I tried the 0018 version of the IDE, but I got some strange java errors there.

Are the P*X#* ports defined at all?

JanD

Can you copy the contents of the ln_config.h file into the top of the .cpp file (as experiment) ?

if that works there is typically an #include error (which is still my current hypothesis)

Still the same :( What should I do???

JanD

AS far as I can see from here it is very strange (never used the lib myself yet). What would I do? I think try a clean install of the lib.

--- update ---

I installed the lib and got teh same errors, then I read the comments in the libn carefully and saw a reference to a 168 board. Changed the board in the IDE -> Tools -> board menu to 168 and the amount of errors was much less. So that should give you a direction to go.

robtillaart: AS far as I can see from here it is very strange (never used the lib myself yet). What would I do? I think try a clean install of the lib.

What do you mean with "a clean install". Do you mean I should re-install it?

JanD

Yep reinstall, but see my prev post, for a better clue. -- update -- => Binary sketch size: 4864 bytes (of a 14336 byte maximum) IDE 21 , locoNetMonitor example Board = .... 168 (third option)

It works now. It looks like the library has been updated since I downloaded it.

JanD

@Jan what board are you using?

Didn't I write it? Uno.

JanD