Error after adding switches to Arduino project

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

Moderator: Benj

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Error after adding switches to Arduino project

Postby MJU » Wed Dec 03, 2014 4:41 pm

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: 14447
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4512 times
Been thanked: 4188 times
Contact:

Re: Error after adding switches to Arduino project

Postby Benj » Wed Dec 03, 2014 6:28 pm

Hello,

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

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: Error after adding switches to Arduino project

Postby MJU » Wed Dec 03, 2014 8:38 pm

Yes, I'm the proud owner of the latest version: 6.1.0.0 (08/10/2014)
These users thanked the author MJU for the post:
Benj (Thu Dec 04, 2014 5:44 pm)
Rating: 5.26%
 

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

Re: Error after adding switches to Arduino project

Postby Benj » Fri Dec 05, 2014 3:29 pm

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: 14447
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4512 times
Been thanked: 4188 times
Contact:

Re: Error after adding switches to Arduino project

Postby Benj » Fri Dec 05, 2014 3:44 pm

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 67 times

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: Error after adding switches to Arduino project

Postby MJU » Fri Dec 05, 2014 6:39 pm

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.
These users thanked the author MJU for the post:
Benj (Fri Dec 05, 2014 6:42 pm)
Rating: 5.26%
 

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: Error after adding switches to Arduino project

Postby MJU » Sat Dec 13, 2014 6:34 pm

No solution for this problem yet?

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: Error after adding switches to Arduino project

Postby MJU » Tue Jan 06, 2015 4:27 pm

Bump.

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

MJU
Posts: 430
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: Error after adding switches to Arduino project

Postby MJU » Tue Jan 20, 2015 6:23 pm

Bump....

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

Re: Error after adding switches to Arduino project

Postby Benj » Wed Jan 21, 2015 1:05 pm

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