Creating a string to be used in a digital output statement
Posted: Thu Mar 19, 2026 9:36 pm
With a Arduino Mega, I want to send a "1" to digital output, say D4.
The "D" will be static. But the port number needs to change.
For example I will have a loop where I increase the integer value of PIN,and send 0 or 1 in a digital write.
In the following statement, for a digital output, the variable "PIN" is an integer.
DigitalOutput = STRING ('D' + PIN) FC is ok with the ststement, but it prints "69"
Any help is paareciated.
The "D" will be static. But the port number needs to change.
For example I will have a loop where I increase the integer value of PIN,and send 0 or 1 in a digital write.
In the following statement, for a digital output, the variable "PIN" is an integer.
DigitalOutput = STRING ('D' + PIN) FC is ok with the ststement, but it prints "69"
Any help is paareciated.