# Adafruit NeoPixel Library [![Build Status](https://github.com/adafruit/Adafruit_NeoPixel/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_NeoPixel/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_NeoPixel/html/index.html)
Arduino library for controlling single-wire-based LED pixels and strip such as the [Adafruit 60 LED/meter Digital LED strip][strip], the [Adafruit FLORA RGB Smart Pixel][flora], the [Adafruit Breadboard-friendly RGB Smart Pixel][pixel], the [Adafruit NeoPixel Stick][stick], and the [Adafruit NeoPixel Shield][shield].
After downloading, rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder. Restart Arduino IDE, then open File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch.
Compatibility notes: Port A is not supported on any AVR processors at this time
[flora]: http://adafruit.com/products/1060
[strip]: http://adafruit.com/products/1138
[pixel]: http://adafruit.com/products/1312
[stick]: http://adafruit.com/products/1426
[shield]: http://adafruit.com/products/1430
---
## Installation
### First Method
![image](https://user-images.githubusercontent.com/36513474/68967967-3e37f480-0803-11ea-91d9-601848c306ee.png)
1. In the Arduino IDE, navigate to Sketch > Include Library > Manage Libraries
1. Then the Library Manager will open and you will find a list of libraries that are already installed or ready for installation.
1. Then search for Neopixel strip using the search bar.
1. Click on the text area and then select the specific version and install it.
### Second Method
1. Navigate to the [Releases page](https://github.com/adafruit/Adafruit_NeoPixel/releases).
1. Download the latest release.
1. Extract the zip file
1. In the Arduino IDE, navigate to Sketch > Include Library > Add .ZIP Library
## Features
- ### Simple to use
Controlling NeoPixels “from scratch” is quite a challenge, so we provide a library letting you focus on the fun and interesting bits.
- ### Give back
The library is free; you don’t have to pay for anything. Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
- ### Supported Chipsets
We have included code for the following chips - sometimes these break for exciting reasons that we can't control in which case please open an issue!
- AVR ATmega and ATtiny (any 8-bit) - 8 MHz, 12 MHz and 16 MHz
- Teensy 3.x and LC
- Arduino Due
- Arduino 101
- ATSAMD21 (Arduino Zero/M0 and other SAMD21 boards) @ 48 MHz
- ATSAMD51 @ 120 MHz
- Adafruit STM32 Feather @ 120 MHz
- ESP8266 any speed
- ESP32 any speed
- Nordic nRF52 (Adafruit Feather nRF52), nRF51 (micro:bit)
- Infineon XMC1100 BootKit @ 32 MHz
- Infineon XMC1100 2Go @ 32 MHz
- Infineon XMC1300 BootKit @ 32 MHz
- Infineon XMC4700 RelaxKit, XMC4800 RelaxKit, XMC4800 IoT Amazon FreeRTOS Kit @ 144 MHz
Check forks for other architectures not listed here!
- ### GNU Lesser General Public License
Adafruit_NeoPixel is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
## Functions
- begin()
- updateLength()
- updateType()
- show()
- delay_ns()
- setPin()
- setPixelColor()
- fill()
- ColorHSV()
- getPixelColor()
- setBrightness()
- getBrightness()
- clear()
- gamma32()
## Examples
There are many examples implemented in this library. One of the examples is below. You can find other examples [here](https://github.com/adafruit/Adafruit_NeoPixel/tree/master/examples)
### Simple
```Cpp
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
#define NUMPIXELS 16
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 500
void setup() {
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
pixels.begin();
}
void loop() {
pixels.clear();
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(0, 150, 0));
pixels.show();
delay(DELAYVAL);
}
}
```
## Contributing
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell others about this library
- Contribute new protocols
Please read [CONTRIBUTING.md](https://github.com/adafruit/Adafruit_NeoPixel/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
### Roadmap
The PRIME DIRECTIVE is to maintain backward compatibility with existing Arduino sketches -- many are hosted elsewhere and don't track changes here, some are in print and can never be changed!
Please don't reformat code for the sake of reformatting code. The resulting large "visual diff" makes it impossible to untangle actual bug fixes from merely rearranged lines. Also, don't bother with PRs for timing adjustments "to better match the datasheet," because the datasheet isn't really true to begin with.
Things I'd Like To Do But There's No Official Timeline So Please Don't Count On Any Of This Ever Being Canonical:
- 400 KHz support can be removed, turns out it was never actually necessary; even the earliest NeoPixels can ingest 800 KHz data. Of course the #defines should remain so old sketches still compile, but both can be set to 0 and would have no effect on anything.
- For the show() function (with all the delicate pixel timing stuff), break out each architecture into separate source files rather than the current unmaintainable tangle of #ifdef statements!
- Please don't use updateLength() or updateType() in new code. They should not have been implemented this way (use the C++ 'new' operator with the regular constructor instead) and are only sticking around because of the Prime Directive. setPin() is OK for now though, it's a trick we can use to 'recycle' pixel memory across multiple strips.
- In the M0 and M4 code, use the hardware systick counter for bit timing rather than hand-tweaked NOPs (a temporary kludge at the time because I wasn't reading systick correctly). (As of 1.4.2, systick is used on M4 devices and it appears to be overclock-compatible. Not for M0 yet, which is why this item is still here.)
- As currently written, brightness scaling is still a "destructive" operation -- pixel values are altered in RAM and the original value as set can't be accurately read back, only approximated, which has been confusing and frustrating to users. It was done this way at the time because NeoPixel timing is strict, AVR microcontrollers (all we had at the time) are limited, and assembly language is hard. All the 32-bit architectures should have no problem handling nondestructive brightness scaling -- calculating each byte immediately before it's sent out the wire, maintaining the original set value in RAM -- the work just hasn't been done. There's a fair chance even the AVR code could manage it with some intense focus. (The DotStar library achieves nondestructive brightness scaling because it doesn't have to manage data timing so carefully...every architecture, even ATtiny, just takes whatever cycles it needs for the multiply/shift operations.)
## Credits
This library is written by Phil "Paint Your Dragon" Burgess for Adafruit Industries, with contributions by PJRC, Michael Miller and other members of the open source community.
## License
Adafruit_NeoPixel is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Adafruit_NeoPixel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without eve
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【项目资源】: 本项目是一个集成了多种先进传感器和控制模块的智能家居控制系统,旨在提供便捷的灯光、风扇、环境温湿度等设备的智能控制功能。系统分为三个主要控制端:STM32_Bluetooth控制端、ESP8266 WiFi控制端和语音控制端。STM32_Bluetooth控制端通过蓝牙APP实现对LED灯的开关和亮度调节、风扇的开关、转速和方向调节,同时根据实时亮度自动触发LED灯照亮,并根据实时温度自动触发风扇降温。ESP8266 WiFi控制端可以远程控制彩灯灯带的颜色和亮度。 【项目质量】: 所有源码都经过严格测试,可以直接运行。 功能在确认正常工作后才上传。 【适用人群】: 适用于希望学习不同技术领域的小白或进阶学习者。 可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【附加价值】: 项目具有较高的学习借鉴价值,也可直接拿来修改复刻。 对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。 【沟通交流】: 有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 鼓励下载和使用,并欢迎大家互相学习,共同进步。
资源推荐
资源详情
资源评论
收起资源包目录
毕设&课设&项目&竞赛-多功能智能家居室内灯光控制系统设计与实现(完整工程资料源码).zip (644个子文件)
Project.uvguix.Administrator 97KB
STM32_Bluetooth.apk 3.86MB
AUTHORS 166B
Project.axf 399KB
Project_sct.Bak 494B
keilkill.bat 399B
stm32f10x_tim.c 107KB
stm32f10x_flash.c 61KB
stm32f10x_rcc.c 50KB
stm32f10x_adc.c 46KB
stm32f10x_i2c.c 45KB
stm32f10x_can.c 44KB
stm32f10x_usart.c 37KB
system_stm32f10x.c 36KB
stm32f10x_fsmc.c 35KB
stm32f10x_spi.c 30KB
stm32f10x_dma.c 29KB
stm32f10x_sdio.c 28KB
stm32f10x_gpio.c 23KB
stm32f10x_dac.c 19KB
core_cm3.c 17KB
tcp_axtls.c 14KB
stm32f10x_cec.c 11KB
stm32f10x_pwr.c 9KB
stm32f10x_rtc.c 8KB
stm32f10x_bkp.c 8KB
OLED.c 8KB
misc.c 7KB
stm32f10x_exti.c 7KB
libsha1.c 7KB
esp.c 6KB
stm32f10x_wwdg.c 6KB
stm32f10x_dbgmcu.c 5KB
stm32f10x_iwdg.c 5KB
stm32f10x_it.c 4KB
Serial.c 4KB
stm32f10x_crc.c 3KB
main.c 3KB
AD.c 3KB
cencode.c 3KB
cdecode.c 3KB
esp8266.c 2KB
OneWire.c 2KB
kendyte_k210.c 2KB
LED.c 2KB
MyI2C.c 2KB
PWM.c 2KB
DS18B20.c 1KB
Motor.c 1KB
Key.c 979B
LightSensor.c 973B
Delay.c 838B
COPYING 7KB
Adafruit_NeoPixel.cpp 119KB
BlinkerUpdater.cpp 43KB
AsyncTCP.cpp 32KB
WebSocketsClient.cpp 32KB
WebSocketsServer.cpp 31KB
Adafruit_MQTT.cpp 30KB
ESPAsyncTCP.cpp 24KB
WebSockets.cpp 24KB
ESPAsyncTCPbuffer.cpp 14KB
painlessMeshConnection.cpp 9KB
SocketIOclient.cpp 9KB
BlinkerUtility.cpp 8KB
SyncClient.cpp 7KB
painlessMeshSTA.cpp 6KB
AsyncPrinter.cpp 5KB
Adafruit_MQTT_Client.cpp 4KB
BLESerial.cpp 4KB
BLESerial.cpp 4KB
BlinkerTimer.cpp 3KB
BlinkerDebug.cpp 3KB
Base64.cpp 3KB
scheduler.cpp 1KB
wifi.cpp 109B
stm32f10x_tim.crf 360KB
main.crf 348KB
stm32f10x_can.crf 347KB
stm32f10x_adc.crf 346KB
stm32f10x_rcc.crf 346KB
stm32f10x_flash.crf 346KB
stm32f10x_i2c.crf 345KB
serial.crf 345KB
stm32f10x_usart.crf 344KB
stm32f10x_fsmc.crf 344KB
stm32f10x_sdio.crf 343KB
stm32f10x_spi.crf 343KB
stm32f10x_gpio.crf 342KB
stm32f10x_dma.crf 342KB
oled.crf 341KB
stm32f10x_dac.crf 340KB
stm32f10x_cec.crf 340KB
system_stm32f10x.crf 340KB
stm32f10x_bkp.crf 340KB
stm32f10x_pwr.crf 340KB
stm32f10x_rtc.crf 340KB
onewire.crf 339KB
stm32f10x_exti.crf 339KB
lightsensor.crf 339KB
共 644 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功