I have this code for Scada :
bool func_D28(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue_D28 = false;
if (opcOP == opc_opwrite) {
ledValue_D28 = value;
if (ledValue_D28)
digitalWrite(pin_D28, HIGH);
else
digitalWrite(pin_D28, LOW);
}
else
return ledValue_D28;
}
I have pin_D28 output, how to convert the code to have outputs on pin_D29, pin_D30?
If you really want to mess with someone's mind you could find the declaration of "pin_D28" and change it to the pin number you desire.
If you want to be kind, use Find and Replace to change all occurrences of "_D28" to "_D29" (or "_D30")
I want everyone to work D_28 , D_29, D_30
Can you have two PCBs on Arduino TX-RX to RX-TX
What code should be written to work both in Scada ?
I'm sorry, I do not understand your question.
What model Arduino do you have?
Why is the function called func_D28()? If you want to change the state of pin D29, then I suggest that you call a function called func_D29() if it exists, and if it doesn't write your own.
Without any more context, it's impossible to suggest solutions. Where did this code come from? Where are you going with it? There's a hundred different ways this could be better, but only when you measure "better" along a defined axis.
bool func_D28(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue_D28 = false;
if (opcOP == opc_opwrite) {
ledValue_D28 = value;
if (ledValue_D28)
digitalWrite(pin_D28, HIGH);
else
digitalWrite(pin_D28, LOW);
}
else
return ledValue_D28;
}
How to add delay to pin output D_28 ?
The word "delay" has a specific meaning in Arduino programs. You can't add "delay" to any pin. That's like adding minutes to oranges.
What do you want it to do? Try not to say HOW you think it might do it, just WHAT are your expected inputs and expected outputs. You're allowed to use more than one short phrase. This isn't Google. Type a paragraph or two.