Обновление до версии 0.3.0

- обновлен elbear_fw_bootloader - добавлена проверка контрольной суммы каждой строки hex файла.
- в модуль работы с АЦП добавлена функция analogReadResolution(). Функция analogRead() теперь возвращает усредненное по 10 измерениям значение.
- общая функция обработки прерываний перенесена в память RAM. Обработчики прерываний модулей External Interrupts и Advanced I/O (функция tone()) так же перенесены в память RAM для увеличения скорости выполнения кода.
- в пакет добавлены библиотеки EEPROM, Servo, SoftSerial, NeoPixel, MFRC522 адаптированные для работы с платой Elbear Ace-Uno.
- добавлено описание особенностей работы с пакетом
This commit was merged in pull request #6.
This commit is contained in:
klassents committed 2024-10-17 08:27:39 +03:00
1 parent 7a7c552743
commit 766b7b32ea
114 files changed
+11064 -666

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
/*
"Broom" Servo
This example demonstrates the servo drive movement
with a smooth stop in both directions
*/
#include <Servo.h>
Servo servo; // create an Servo class instance to control the servo
int pos = 0; // variable for storing servo position
void setup() {
servo.attach(8); // connecting the servo drive to digital pin 8 (D8)
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // change degrees from 0 to 180
servo.write(pos); // command to servo drive - go to position of variable "pos"
delay(15); // waiting for the servo to get there
}
for (pos = 180; pos >= 0; pos -= 1) { // change degrees from 180 to 0
servo.write(pos); // command to servo drive - go to position of variable "pos"
delay(15); // waiting for the servo to get there
}
}
+25
View File
@@ -0,0 +1,25 @@
/*
"Jerks"
This example demonstrates the servo drive movement
with a sharp stop in both directions
*/
#include <Servo.h>
Servo servo; // create an Servo class instance to control the servo
void setup() {
servo.attach(8); // connecting the servo drive to digital pin 8 (D8)
}
void loop() {
servo.write(0); // command to the servo drive - go to the 0 degree position (clockwise movement)
delay(1000); // wait
servo.write(90); // stop movement
delay(1000); // wait
servo.write(180); // command to the servo drive - move to the 180 degree position (counterclockwise movement)
delay(1000); // wait
servo.write(90); // stop movement
delay(1000); // wait
}
@@ -0,0 +1,24 @@
/*
"Resist"
This example demonstrates the servo drive movement
depending on the value on the potentiometer
*/
#include <Servo.h>
Servo servo; // create an Servo class instance to control the servo
int potpin = A0; // analog pin used to connect a potentiometer
int val; // variable for reading the analog output value
void setup() {
servo.attach(8); // connecting the servo drive to digital pin 8 (D8)
}
void loop() {
val = analogRead(potpin); // reading the potentiometer value (value from 0 to 4096)
val = map(val, 0, 4096, 0, 180); // change scale for use with servo (value from 0 to 180)
servo.write(val); // setting the servo position according to the value
delay(15); // waiting for the servo to get there
}