Generating a single pulse without using delay and resources
hello,
for railroad project drive electro magnet. how can generate single pulse (-+ 200 - 250 ms)?
now use function reads values each time check takes of resources of arduino mega think.
delay,... isn't available in case.
i found topics wasn't thing.
regards,
minitreintje
for railroad project drive electro magnet. how can generate single pulse (-+ 200 - 250 ms)?
now use function reads values each time check takes of resources of arduino mega think.
delay,... isn't available in case.
i found topics wasn't thing.
regards,
minitreintje
code: [select]
void loop() {
static unsigned long pulsetimer.
if (timetodoapulse && !doingapulse) {
doingapulse = true;
pulsetimer = millis();
digitalwrite(solenoidpin, high);
}
if (doingapulse && millis() - pulsetimer >= 225) {
digitalwrite(solenoidpin, low);
doingapulse=false;
}
}
Arduino Forum > Using Arduino > Programming Questions > Generating a single pulse without using delay and resources
arduino
Comments
Post a Comment