Go Down

Topic: Problem with LocoNet library (Read 3008 times) previous topic - next topic

JanD

Hello,

then uploading the LocoNetMonitor example to my Uno, I get the following error messages:
Code: [Select]
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

robtillaart

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.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JanD

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

JanD

robtillaart


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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JanD

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

Are the PX# ports defined at all?

JanD

robtillaart

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)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JanD

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

JanD

robtillaart

#7
Feb 17, 2011, 05:16 pm Last Edit: Feb 17, 2011, 05:32 pm by robtillaart Reason: 1
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.



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

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.



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

JanD

robtillaart

#9
Feb 17, 2011, 05:33 pm Last Edit: Feb 17, 2011, 05:57 pm by robtillaart Reason: 1
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)


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JanD

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

JanD

robtillaart

@Jan
what board are you using?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JanD


Go Up