Welcome Guest! To enable all features please Login or Register.
Options
Go to last post Go to first unread
microspace  
#1 Posted : Thursday, April 02, 2015 12:27:26 AM(UTC)
microspace

Rank: Member

Groups: BetaUser, Registered
Joined: 2/7/2015(UTC)
Posts: 17

Thanks: 4 times
I try to create custom arduino node for MAX7219 based 8x8 led array
I use this code

I get these errors:


I think "byte" is not supported. Actually it is hard to debug node's code.
It would be better if you place line numbers in custom node and display error number line.
Where to put C function definitions? in setup code or in declaration code?

Edited by user Saturday, April 04, 2015 9:16:27 PM(UTC)  | Reason: Not specified

EmbrioAdmin  
#2 Posted : Thursday, April 02, 2015 6:59:25 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
I would put your functions in the deceleration box. Those get added to the top of the compiled Arduino program, having them in the setup code box puts them in the Arduino setup function, which isn't where they belong.

The other problem is a silly bug you uncovered. In order to make variables local to the node they are in, when the program is compiled the variable names (which are listed under the deceleration box) are replaced with a unique value. I guess the code that does that needs to be better, because your variable "e" was replacing all of the e's, including the one at the end of "byte", with a new string. For now use longer variable names, I'll see what I can do about fixing that. I'll also convert the variable names back when they are included as an error, showing the randomized variable names in the error message isn't useful at all.

Let me know if you still can't get it to work after moving the functions to the deceleration block and using longer variables.
microspace  
#3 Posted : Thursday, April 02, 2015 6:26:17 PM(UTC)
microspace

Rank: Member

Groups: BetaUser, Registered
Joined: 2/7/2015(UTC)
Posts: 17

Thanks: 4 times
Now I get
Code:
Duplicate Variables: c, (, {, >
error.
Also I had to delete all comments because Embrio thinks that commented words are variables.

EmbrioAdmin  
#4 Posted : Thursday, April 02, 2015 7:00:12 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
Thank you for the update, you're pushing the custom nodes farther than I have so far. I'll focus tomorrow on fixing the bugs that are keeping this node from working.
EmbrioAdmin  
#5 Posted : Friday, April 03, 2015 11:03:11 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
I just posted a new installer with the variable name replacing fixed. Thanks for letting me know about the problem. Let me know if you have other issues!
microspace  
#6 Posted : Saturday, April 04, 2015 9:14:04 PM(UTC)
microspace

Rank: Member

Groups: BetaUser, Registered
Joined: 2/7/2015(UTC)
Posts: 17

Thanks: 4 times
Wow! It is working perfectly in both modes! Thank you!
Here is working node source to control one MAX7219 based 8x8 LED matrix.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error