This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
README.md
and use allman
astyle
- Loading branch information
1 parent
2fbea67
commit 114dc0c
Showing
19 changed files
with
245 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
ESP8266_ISR_MultiServos.ino | ||
For ESP8266 boards | ||
Written by Khoi Hoang | ||
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_ISR_Servo | ||
Licensed under MIT license | ||
The ESP8266 timers are badly designed, using only 23-bit counter along with maximum 256 prescaler. They're only better than UNO / Mega. | ||
The ESP8266 has two hardware timers, but timer0 has been used for WiFi and it's not advisable to use. Only timer1 is available. | ||
The timer1's 23-bit counter terribly can count only up to 8,388,607. So the timer1 maximum interval is very short. | ||
|
@@ -19,7 +19,7 @@ | |
Loosely based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
The ESP8266 timers are badly designed, using only 23-bit counter along with maximum 256 prescaler. They're only better than UNO / Mega. | ||
The ESP8266 has two hardware timers, but timer0 has been used for WiFi and it's not advisable to use. Only timer1 is available. | ||
The timer1's 23-bit counter terribly can count only up to 8,388,607. So the timer1 maximum interval is very short. | ||
|
@@ -87,13 +87,15 @@ int servoIndex2 = -1; | |
void setup() | ||
{ | ||
Serial.begin(115200); | ||
|
||
while (!Serial); | ||
|
||
delay(200); | ||
|
||
Serial.print(F("\nStarting ESP8266_ISR_MultiServos on ")); Serial.println(ARDUINO_BOARD); | ||
Serial.print(F("\nStarting ESP8266_ISR_MultiServos on ")); | ||
Serial.println(ARDUINO_BOARD); | ||
Serial.println(ESP8266_ISR_SERVO_VERSION); | ||
|
||
servoIndex1 = ISR_Servo.setupServo(D8, MIN_MICROS, MAX_MICROS); | ||
servoIndex2 = ISR_Servo.setupServo(D7, MIN_MICROS, MAX_MICROS); | ||
|
||
|
@@ -121,10 +123,12 @@ void loop() | |
|
||
if (position % 30 == 0) | ||
{ | ||
Serial.print(F("Servo1 pos = ")); Serial.print(position); | ||
Serial.print(F(", Servo2 pos = ")); Serial.println(180 - position); | ||
Serial.print(F("Servo1 pos = ")); | ||
Serial.print(position); | ||
Serial.print(F(", Servo2 pos = ")); | ||
Serial.println(180 - position); | ||
} | ||
|
||
ISR_Servo.setPosition(servoIndex1, position); | ||
ISR_Servo.setPosition(servoIndex2, 180 - position); | ||
// waits 15ms for the servo to reach the position | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.