Output to a pin

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

Moderator: Benj

Post Reply
mnf
Valued Contributor
Valued Contributor
Posts: 860
Joined: Wed May 31, 2017 11:57 am
Contact:

Output to a pin

Post by mnf »

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.

Martin

User avatar
LeighM
Matrix Staff
Posts: 2093
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: Output to a pin

Post by LeighM »

Hi,
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.
Leigh
Attachments
Property copy on compile start.fcfx
(11.59 KiB) Downloaded 101 times

Post Reply