New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genereated code for number var is incorrect (Constant Blocks) #3

Closed
HBL opened this Issue Nov 26, 2011 · 5 comments

Comments

Projects
None yet
5 participants
@HBL

HBL commented Nov 26, 2011

The code generated for a number variable is not correct. The value is ignored and written as 0. See the following example:
Blocks
Code

@heqichen

This comment has been minimized.

Show comment
Hide comment
@heqichen

heqichen Nov 26, 2011

Collaborator

you should put "set variable block" into the loop or they will be ignored

Collaborator

heqichen commented Nov 26, 2011

you should put "set variable block" into the loop or they will be ignored

@HBL

This comment has been minimized.

Show comment
Hide comment
@HBL

HBL Nov 26, 2011

As they are constants I want to have them in the setup loop (it's unwanted to executed these every loop), and that's where they are generated now. Although without value. When I manually edit the code by replacing the zeros by the correct pin numbers, it's works fine on the Arduino. So I think what I did in ArduBlock should work.

HBL commented Nov 26, 2011

As they are constants I want to have them in the setup loop (it's unwanted to executed these every loop), and that's where they are generated now. Although without value. When I manually edit the code by replacing the zeros by the correct pin numbers, it's works fine on the Arduino. So I think what I did in ArduBlock should work.

@taweili

This comment has been minimized.

Show comment
Hide comment
@taweili

taweili Nov 27, 2011

Owner

Hi HBL, thanks for the feedback. I think this makes good case of either having a "setup" block or a "constant." Or make a spacial case for "set var" block outside of "loop."

Maybe a "constant" block is best and we can use the #define in the language to save a few bytes in the resulting binary.

Owner

taweili commented Nov 27, 2011

Hi HBL, thanks for the feedback. I think this makes good case of either having a "setup" block or a "constant." Or make a spacial case for "set var" block outside of "loop."

Maybe a "constant" block is best and we can use the #define in the language to save a few bytes in the resulting binary.

@Edubits

This comment has been minimized.

Show comment
Hide comment
@Edubits

Edubits Nov 27, 2011

Sounds good to me! Thanks a lot for your work!

Edubits commented Nov 27, 2011

Sounds good to me! Thanks a lot for your work!

@AndrewCPaterson

This comment has been minimized.

Show comment
Hide comment
@AndrewCPaterson

AndrewCPaterson May 27, 2013

I've just run into this same problem. Was this ever addressed?

AndrewCPaterson commented May 27, 2013

I've just run into this same problem. Was this ever addressed?

@taweili taweili closed this Oct 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment