Page 1 of 1

Programing invidual Arduino ports I/O pins

Posted: Tue Aug 17, 2021 3:37 am
by RolGOV
Greetings FLOWCODE Forum,

As a FLOWCODE novice I am trying to perform the following using the Command Icons:

Arduino PORT------ Pins-------------- I/O Condition
PORTD--------- D2, D1, D0 ------------ inputs;

PORTD--------- D7, D6, D5, D4, D3 ---- Outputs.

I hope I have been able to illustrate my request.

Thanks to everyone for reading the above.

Best regards,

Rolando

Re: Programing invidual Arduino ports I/O pins

Posted: Tue Aug 17, 2021 6:09 am
by mnfisher
Hi RolGiv,

There are several ways to do what you want.

You can use input and output macros.

You can add properties (ie d0 single digital pin) then use a calculation block
x= d0 (input)
d0 = 1

You can set the direction registers using a C block
DDRD = 0b11111000;
Then set or read multiple or single pins by writing or reading PORTD.

Using d0 and d 1 makes life a bit harder on a uno

Martin

Re: Programing invidual Arduino ports I/O pins

Posted: Wed Aug 18, 2021 4:12 am
by RolGOV
Hello Martin, thank you so much for your reply. Thanks to the information included in your reply I have become more aware how powerful Flowcode can be. Thank you once again. Rolando