There are 4 pulse mode devices which should properly work with Arduino Micro.
Devices are very stupid and has no any configuration. one pulse between 5-65 ms and it take a command.
Got a problem when I restart or turn on my Arduino Micro.
I get junk command to my pulse devices just Immediately after reset or turn it on. (Arduino).
All PinModes installed proper so I think it is some boot load pin check which switch pins before IDE program loads.
I have no ideas how to solve this in soft way. Some friends suggest hardware solution to make trimer before loading...
Any ideas to solve this first boot contact bounce in a time matter? 1-3 seconds will enough.
IDE code doesn't matter. This problem could be repeated just by few lines.
Background: Devises connected just only by common ground and control pin. (2 pins total)
What investigate:
Pinmode out - if this line in the code then devices take a command even i don't send arduino pin value; it happened just by 'control' pin line disconnection. some bounce or etc.
When control line connected but take off arduino from USB - then Device take a command.
It possible to avoid "USB arduino disconnection unlike command".
The working logic to take command is:
a: turn on TRSB device control line
b: make a pulse command (10 ms) HIGH)
c: turn OFF TRSB device control line
d command (10 ms) LOW)
but if i put D before C i got double command. so connection and disconnection Pulse device control line make unlike command. Don't know why. Maybe this is some Pulse protocol specific which i don't know how to care about.
void setup() {
// put your setup code here, to run once:
pinMode(05,OUTPUT);
digitalWrite(5,LOW);
}
void loop() {
// put your main code here, to run repeatedly:
delay(5000);
digitalWrite(5,HIGH);
delay(10);
digitalWrite(5,LOW);
delay(5000);
}
Do you realize that with the two 5 second delays inside your loop(), you will get a delay of 5 seconds after reset, then the rest of the time you will get a delay of 10 seconds.