Pages: [1]   Go Down
Author Topic: Problem with LocoNet library  (Read 2141 times)
0 Members and 1 Guest are viewing this topic.
Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

JanD
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still the same smiley-sad What should I do???

JanD
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.



« Last Edit: February 17, 2011, 11:32:39 am by robtillaart » Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)


« Last Edit: February 17, 2011, 11:57:28 am by robtillaart » Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

JanD
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Jan
what board are you using?
Logged

Rob Tillaart

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

Sweden
Offline Offline
Full Member
***
Karma: 10
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Didn't I write it? Uno.

JanD
Logged

Pages: [1]   Go Up
Jump to: