Page 1 of 1

Output to a pin

Posted: Wed Nov 22, 2017 4:44 pm
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

Re: Output to a pin

Posted: Mon Nov 27, 2017 11:11 am
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