Error Message doesn't make sense

Howdy, James!!!

Ok, I am having an issue using the analog pins, and declaring them as an integer. They are to be used as digital I/O…
The error says… Says, Well, here is the code.

const int LB_REVERSE_track_outbound_direction = 6;     // Traffic Direction control line, LOW for Leftbound traffic on passing track(OUTPUT)
const int RB_REVERSE_track_inbound_direction = 7;      // Traffic Direction control line, LOW for Rightbound Traffic on Passing Track(INPUT)
const int LB_NORMAL_outbound_Direction = 8;            // Traffic Direction control line, LOW for Leftbound Traffic on MAIN Track(OUTPUT)
const int RB_NORMAL_inbound_Direction = 9;             // Traffic Direction control line, LOW for Rightbound Traffic on MAIN Track(INPUT)
const int MAIN_Right_inbound = 10;                     // Traffic Direction control line, LOW for Leftbound Traffic on MAIN Track(INPUT)
const int MAIN_Right_outbound = 11;                    // Traffic Direction control line, LOW for Rightbound Traffic on MAIN Track(OUTPUT)
const int CP_block_full = 12;                          // Control Point Block Detector, LOW for occupied(INPUT)

// DISPATCH PANEL Signal control and display, are using the Analog I/O Pins as digital control

const int CODE = A5;                                   // Code Button on Dispatch Panel(INPUT)
const int LB_SIGNAL_SELECT = A4;                       // Leftbound Signal Select on Dispatch Panel(INPUT)
const int RB_SIGNAL_SELECT = A3;                       // Rightbound Signal Select on Dispatch Panel(INPUT)
const int LB_SIGNAL_GRN = A2;                          // Leftbound Signal Green LED on Dispatch Panel(OUTPUT)
const int SIGNAL_Stop_RED = A1;                        // Signal Stop red LED on Dispatch Panel(OUTPUT)
const int RB_SIGNAL_GRN = A0;                          // Rightbound Signal Green LED on Dispatch Panel(OUTPUT)

Here is the error message. This occurs ONLY on the Analog pins. Everything else is just fine. I cannot seem to understand why it does not behave like the other declarations.

I seem to be on the wrong track here. Would you mind telling me what I am missing here??

Many Thanks, folks!!!

Best Regards;

Taz…

2 Likes

Based on the numbers you are using for the analog pins I would guess that this is Arduino code. If the message is saying something about the values not being declared then that indicates that the current selected board does not support those pins, or that the correct board is selected but the definition file for the board has become corrupted. What device are you compiling for?

2 Likes

Thank you for your response.

I am programming using the Arduino UNO ISP, and programming Atmega328p-pu controllers.

I appreciate your help!

Taz…

1 Like

What is the error message?

What is the device that is connected and what is the board that you have selected in the IDE? Do they match? You can confirm the board definition from the compiler log. For instance, for a UNO it would be :
Using board ‘uno’ from platform in folder:
C:\Users\x\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5
Using core ‘arduino’ from platform in folder:
C:\Users\x\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

4 Likes

Hi Kim,

I think the problem lies with “A7” being a string rather than an integer, and as such can’t be assigned to an integer variable. Try PIN_A7 instead of just A7. The Arduino Core should resolve that into a number that can be stored in your integer variable

Hang on, I may have the wrong “core” loaded, see Jeff’s comment. Add your error messages to your post, and send us a screenshot of your selected board and programmer

-James

2 Likes

Hello, James, and Jeff…

You guys are the best!!! !! I found it had been selected for an Attiny85. I had neglected to change it. The error, was indeed mine.
Sorry to have taken up your valuable time on this. Sometimes, my old man brain needs a kick start, and you did it… again… lol!!!
THANK YOU SO VERY MUCH!!!
Taz…

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Kims\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Kims\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Kims\Documents\Arduino\libraries -fqbn=ATTinyCore:avr:attinyx5:LTO=enable,TimerClockSource=default,chip=85,clock=8internal,eesave=aenable,bod=disable,millis=enabled -ide-version=10819 -build-path C:\Users\Kims\AppData\Local\Temp\arduino_build_862933 -warnings=all -build-cache C:\Users\Kims\AppData\Local\Temp\arduino_cache_807794 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b -prefs=runtime.tools.micronucleus-2.5-azd1b.path=C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b -prefs=runtime.tools.avr-gcc.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18 -prefs=runtime.tools.avrdude-6.3.0-arduino18.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18 -verbose I:\1A CTC SIGNAL SCHEMATICS\CONTROL POINT FIRMWARE\Cotrol_point_Firmware\Cotrol_point_Firmware.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Kims\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Kims\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Kims\Documents\Arduino\libraries -fqbn=ATTinyCore:avr:attinyx5:LTO=enable,TimerClockSource=default,chip=85,clock=8internal,eesave=aenable,bod=disable,millis=enabled -ide-version=10819 -build-path C:\Users\Kims\AppData\Local\Temp\arduino_build_862933 -warnings=all -build-cache C:\Users\Kims\AppData\Local\Temp\arduino_cache_807794 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b -prefs=runtime.tools.micronucleus-2.5-azd1b.path=C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b -prefs=runtime.tools.avr-gcc.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18 -prefs=runtime.tools.avrdude-6.3.0-arduino18.path=C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18 -verbose I:\1A CTC SIGNAL SCHEMATICS\CONTROL POINT FIRMWARE\Cotrol_point_Firmware\Cotrol_point_Firmware.ino

Using board ‘attinyx5’ from platform in folder: C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2

Using core ‘tiny’ from platform in folder: C:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2

Detecting libraries used…

“C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DCLOCK_SOURCE=0 -DARDUINO=10819 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\cores\tiny” “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\variants\tinyX5” “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\sketch\Cotrol_point_Firmware.ino.cpp” -o nul

Generating function prototypes…

“C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DCLOCK_SOURCE=0 -DARDUINO=10819 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\cores\tiny” “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\variants\tinyX5” “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\sketch\Cotrol_point_Firmware.ino.cpp” -o “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\preproc\ctags_target_for_gcc_minus_e.cpp”

“C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags” -u --language-force=c++ -f - --c+±kinds=svpf --fields=KSTtzns --line-directives “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\preproc\ctags_target_for_gcc_minus_e.cpp”

Compiling sketch…

“C:\Users\Kims\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++” -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=attiny85 -DF_CPU=8000000L -DCLOCK_SOURCE=0 -DARDUINO=10819 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\cores\tiny” “-IC:\Users\Kims\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\variants\tinyX5” “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\sketch\Cotrol_point_Firmware.ino.cpp” -o “C:\Users\Kims\AppData\Local\Temp\arduino_build_862933\sketch\Cotrol_point_Firmware.ino.cpp.o”

Cotrol_point_Firmware:26:18: error: ‘A5’ was not declared in this scope

const int CODE = A5; // Code Button on Dispatch Panel(INPUT)

              ^~

I:\1A CTC SIGNAL SCHEMATICS\CONTROL POINT FIRMWARE\Cotrol_point_Firmware\Cotrol_point_Firmware.ino:26:18: note: suggested alternative: ‘A3’

const int CODE = A5; // Code Button on Dispatch Panel(INPUT)

              ^~

              A3

Cotrol_point_Firmware:27:30: error: ‘A4’ was not declared in this scope

const int LB_SIGNAL_SELECT = A4; // Leftbound Signal Select on Dispatch Panel(INPUT)

                          ^~

I:\1A CTC SIGNAL SCHEMATICS\CONTROL POINT FIRMWARE\Cotrol_point_Firmware\Cotrol_point_Firmware.ino:27:30: note: suggested alternative: ‘A3’

const int LB_SIGNAL_SELECT = A4; // Leftbound Signal Select on Dispatch Panel(INPUT)

                          ^~

                          A3

exit status 1

‘A5’ was not declared in this scope

Now, This usually means I haven’t declared it as an integer. I am using the Spence - Konde core.

Here is the screen shots requested. Let me know if you need to view more.

2 Likes

Hello, James…

I am having the issues of servo driving with the ATtiny85, and I cannot remember what we had to include, because they removed the support for servo’s. Is there a way to look at previous post here, because you put it in one of my sketches, and I cannot seem to find the one you gave me to include so it would work correctly.

Thanks for your time!!!

Taz…