forked from Elron_dev/elbear_arduino_bsp
Обновление до версии 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 is contained in:
1 parent
7a7c552743
commit
766b7b32ea
114 files changed
+11064
-666
No files matched your search
@@ -0,0 +1,57 @@
|
||||
#include <NeoPixel.h>
|
||||
|
||||
#define PIN 2
|
||||
#define NUMPIXELS 8
|
||||
|
||||
NeoPixel pixels(NUMPIXELS, PIN);
|
||||
|
||||
void setup() {
|
||||
// init Serial and pin for led control
|
||||
Serial.begin(9600);
|
||||
pixels.begin();
|
||||
Serial.println("pixels.begin");
|
||||
delay(1000);
|
||||
// clear pixels and show
|
||||
pixels.clear();
|
||||
pixels.show();
|
||||
Serial.println("pixels.clear");
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// sequentially set a new pixel color and show it
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, pixels.Color(0xff, 0x00, 0x00));
|
||||
pixels.show();
|
||||
}
|
||||
Serial.println("pixels.Color red");
|
||||
delay(1000);
|
||||
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, pixels.Color(0x00, 0xff, 0x00));
|
||||
pixels.show();
|
||||
}
|
||||
Serial.println("pixels.Color green");
|
||||
delay(1000);
|
||||
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, pixels.Color(0x00, 0x00, 0xff));
|
||||
pixels.show();
|
||||
}
|
||||
Serial.println("pixels.Color blue");
|
||||
delay(1000);
|
||||
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, pixels.Color(0xff, 0xff, 0xff));
|
||||
pixels.show();
|
||||
}
|
||||
Serial.println("pixels.Color white");
|
||||
delay(1000);
|
||||
|
||||
// clear leds
|
||||
pixels.clear();
|
||||
pixels.show();
|
||||
Serial.println("pixels.clear");
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user