Output to a pin

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

Moderator: Benj

Valued Contributor
Valued Contributor
Posts: 621
Joined: Wed May 31, 2017 11:57 am
Has thanked: 56 times
Been thanked: 340 times

Output to a pin

Postby mnf » Wed Nov 22, 2017 4:44 pm

How do I go about writing to a user defined pin?

Specifically - I want to write to the CE pin defined in a user component (but not from within the component)
- for example NRF24L01...
I'd like CE = HIGH (or 1), Delay(10us), CE = LOW

Looking at the C generated we have FCP_SET(B, B, 2, 4, 0) (for example) - but using this isn't portable since the Flowcode to C translator has already done it's magic and assigned the necessary values in the code.

I've tried a calculation box with nrf24l01::ce_pin as the variable. No joy..

The Output flowcode icon requires port and bit to be specified - can I do this programmatically? This only seems to allow hard-coded values (- how would I output a variable to a port rather than specifying the value at compile time (for example PortB = x)

Thanks for any pointers.

These users thanked the author mnf for the post:
STibor (Tue Dec 05, 2017 4:16 am)
Rating: 5.26%

User avatar
Matrix Staff
Posts: 1962
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 474 times
Been thanked: 674 times

Re: Output to a pin

Postby LeighM » Mon Nov 27, 2017 11:11 am

Please see attached example of copying a property on compiler start.
I think this should do what you want, if I understood the question correctly.
Property copy on compile start.fcfx
(11.68 KiB) Downloaded 74 times
These users thanked the author LeighM for the post (total 2):
mnf (Mon Nov 27, 2017 9:55 pm) • STibor (Tue Dec 05, 2017 4:15 am)
Rating: 10.53%