Error after adding switches to Arduino project

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Error after adding switches to Arduino project

Post by MJU »

When I add a switch array in a Flowcode Arduino project, I get following errors:
Launching compiler...

C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller>"C:\PROGRA~1\Flowcode\v6\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega328p -Os -funsigned-char -o "C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.elf" "C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c" -lm
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: (Each undeclared identifier is reported only once
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: for each function it appears in.)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:355: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:355: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:393: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:393: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:451: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:451: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:489: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:489: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:527: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:527: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:580: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:580: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:618: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:618: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:656: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:656: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:709: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:709: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:747: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:747: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:785: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:785: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:838: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:838: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:876: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:876: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:914: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:914: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:967: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:967: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1005: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1005: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1043: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1043: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1095: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1095: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1213: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1213: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1384: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1384: error: 'FCP_TRIS_A' undeclared (first use in this function)

Error returned from [avr-gcc.exe]
.
Completed compilation, return = 1
Without the switch array it works fine.
Any idea?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error after adding switches to Arduino project

Post by Benj »

Hello,

Are you using Flowcode version 6.1? I think this bug should be fixed in this version.

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Error after adding switches to Arduino project

Post by MJU »

Yes, I'm the proud owner of the latest version: 6.1.0.0 (08/10/2014)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error after adding switches to Arduino project

Post by Benj »

Hello,

I wonder was the program created in an earlier version? If not then we might have missed the fix on a specific component.

The problem is that the array components use a single hidden component like a switch or LED and then clone this as many times as the user requires. The hidden component has the default port connection A0 which may not be present on some devices and causes the compile error.

If you open the component debugger window, click the show full property tree then you should be able to use the drop down menu at the top of the properties window to find the hidden component and give it a meaningful connection. Don't worry it won't actually be used anywhere in the compiled code it just keeps the compiler happy.

I will go through all the array components now and ensure that the latest fix has gone in. The fix is to assign the hidden component the same connection as the switch or led at index 0 of the array component which should ensure it is valid for the selected device.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error after adding switches to Arduino project

Post by Benj »

Found the problem, The LEDs had been fixed but not the switches.

These should solve the issue for you.
SwitchArrayFix.zip
(38.21 KiB) Downloaded 230 times

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Error after adding switches to Arduino project

Post by MJU »

I'm sorry but this fix doesn't fix the issue. :roll: :roll:
I've put the fixed components in my V6 "components" directory, but get the same errors.

The file was created with 6.1 and the errors keep appearing.

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Error after adding switches to Arduino project

Post by MJU »

No solution for this problem yet?

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Error after adding switches to Arduino project

Post by MJU »

Bump.

Still no solution?
The previous didn't do the trick.

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Error after adding switches to Arduino project

Post by MJU »

Bump....

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error after adding switches to Arduino project

Post by Benj »

Hello,

Hmm this one should have gone away. I will re-check. Edit I cannot replicate this problem so I think it should be fixed in the next update release.

You can work around the problem for now by adding this to the supplementary code in the project options.

#define PORTA PORTB
#define PINA PINB
#define DDRA DDRB

Post Reply