mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-29 05:21:37 +03:00
Ticker library update
This commit is contained in:
@ -28,7 +28,7 @@ void flip()
|
||||
// when the counter reaches a certain value, start blinking like crazy
|
||||
if (count == 20)
|
||||
{
|
||||
flipper.attach(&flip, 0.1);
|
||||
flipper.attach(0.1, flip);
|
||||
}
|
||||
// when the counter reaches yet another value, stop blinking
|
||||
else if (count == 120)
|
||||
@ -42,7 +42,7 @@ void setup() {
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
// flip the pin every 0.3s
|
||||
flipper.attach(&flip, 0.3);
|
||||
flipper.attach(0.3, flip);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
@ -25,11 +25,11 @@ void setup() {
|
||||
pinMode(1, OUTPUT);
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
// call setPin(0) every 25 ms
|
||||
tickerSetLow.attach_ms(&setPin, 25, 0);
|
||||
// every 25 ms, call setPin(0)
|
||||
tickerSetLow.attach_ms(25, setPin, 0);
|
||||
|
||||
// call setPin(1) every 26 ms
|
||||
tickerSetHigh.attach_ms(&setPin, 26, 1);
|
||||
// every 26 ms, call setPin(1)
|
||||
tickerSetHigh.attach_ms(26, setPin, 1);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
Reference in New Issue
Block a user