Programing invidual Arduino ports I/O pins

For general Flowcode discussion that does not belong in the other sections.
Post Reply
RolGOV
Posts: 2
http://meble-kuchenne.info.pl
Joined: Wed Feb 10, 2021 11:35 pm

Programing invidual Arduino ports I/O pins

Post 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

mnfisher
Valued Contributor
Posts: 1056
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 107 times
Been thanked: 546 times

Re: Programing invidual Arduino ports I/O pins

Post 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

RolGOV
Posts: 2
Joined: Wed Feb 10, 2021 11:35 pm

Re: Programing invidual Arduino ports I/O pins

Post 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

Post Reply