Go Down

Topic: Why can't I use integer called "AS2" in my program? (Read 749 times) previous topic - next topic

521minsu

Mar 31, 2016, 09:44 am Last Edit: Mar 31, 2016, 10:07 am by 521minsu
Code: [Select]

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\iom2560.h:38:0,

                from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:174,

                from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:88,

                from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                from sketch\multiple_color_sensor_test.ino.cpp:1:

multiple_color_sensor_test:4: error: expected unqualified-id before numeric constant

int AS2 = 22;

    ^

exit status 1
expected unqualified-id before numeric constant


This is the error message that I'm getting from my little project. However, this is so strange, because when I do anything else than "AS2" that code works perfectly fine. Like "aS2," "BS2," etc. Do you guys know what happened to me? There is my code file in case you need it. Thanks for your contribution to my topic:)

MarkT

Its a #define for one of the bits in the ASSR register.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

MarkT

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up