资源简介
ESP8266 开发代码 机智云 天气状况显示 云平台 APP实时显示。。。。。
代码片段和文件信息
#include “driver/Adafruit_NeoPixel.h“
#include “ets_sys.h“
#include “osapi.h“
#define GPIO_OUTPUT_SET(gpio_no bit_value) \
gpio_output_set(bit_value<
//I just used a scope to figure out the right time periods.
void SEND_WS_0()
{
uint8_t time;
time = 3; while(time--) WRITE_PERI_REG( PERIPHS_GPIO_baseADDR + GPIO_ID_PIN(WSGPIO) 1 );
time = 8; while(time--) WRITE_PERI_REG( PERIPHS_GPIO_baseADDR + GPIO_ID_PIN(WSGPIO) 0 );
}
void SEND_WS_1()
{
uint8_t time;
time = 7; while(time--) WRITE_PERI_REG( PERIPHS_GPIO_baseADDR + GPIO_ID_PIN(WSGPIO) 1 );
time = 5; while(time--) WRITE_PERI_REG( PERIPHS_GPIO_baseADDR + GPIO_ID_PIN(WSGPIO) 0 );
}
void ICACHE_FLASH_ATTR WS2812Send_8bit( uint8_t dat )
{
uint16_t i;
GPIO_OUTPUT_SET(GPIO_ID_PIN(WSGPIO) 0);
ets_intr_lock();
uint8_t mask = 0x80;
uint8_t byte = dat;
while (mask)
{
if( byte & mask ) SEND_WS_1(); else SEND_WS_0();
mask >>= 1;
}
ets_intr_unlock();
}
//GRB formatMSB firsr.
void ICACHE_FLASH_ATTR WS2812BSend_24bit(uint8_t R uint8_t G uint8_t B)
{
WS2812Send_8bit(G);
WS2812Send_8bit(R);
WS2812Send_8bit(B);
}
//delay for millisecond
void HAL_Delay(int time)
{
os_delay_us(time*1000);
}
uint8_t rBuffer[PIXEL_MAX]={0};
uint8_t gBuffer[PIXEL_MAX]={0};
uint8_t bBuffer[PIXEL_MAX]={0};
void ICACHE_FLASH_ATTR setAllPixelColor(uint8_t r uint8_t g uint8_t b)
{
uint8_t i=0;
for(i=0;i {
rBuffer[i]=0;
gBuffer[i]=0;
bBuffer[i]=0;
}
for(i=0;i {
rBuffer[i]=r;
gBuffer[i]=g;
bBuffer[i]=b;
}
for(i=0;i {
WS2812BSend_24bit(rBuffer[i]gBuffer[i]bBuffer[i]);
}
}
void ICACHE_FLASH_ATTR setPixelColor(uint16_t n uint8_t r uint8_t g uint8_t b)
{
uint8_t i=0;
for(i=0;i {
rBuffer[i]=0;
gBuffer[i]=0;
bBuffer[i]=0;
}
rBuffer[n]=r;
gBuffer[n]=g;
bBuffer[n]=b;
for(i=0;i {
WS2812BSend_24bit(rBuffer[i]gBuffer[i]bBuffer[i]);
}
}
void SetPixelColor(uint16_t n uint32_t c)
{
uint8_t i=0;
rBuffer[n]=(uint8_t)(c>>16);
gBuffer[n]=(uint8_t)(c>>8);
bBuffer[n]=(uint8_t)c;
for(i=0;i {
WS2812BSend_24bit(rBuffer[i]gBuffer[i]bBuffer[i]);
}
}
uint32_t Color(uint8_t r uint8_t g uint8_t b)
{
return ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
}
uint32_t Wheel(uint8_t WheelPos)
{
WheelPos = 255 - WheelPos;
if(WheelPos < 85)
{
return Color(255 - WheelPos * 3 0 WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return Color(0 WheelPos * 3 255 - WheelPos * 3);
}
WheelPos -= 170;
return Color(WheelPos * 3 255 - WheelPos * 3 0);
}
//2¨ºo?
void rainbow(uint8_t wait)
{
uint16_t i j;
for(j=0; j<256; j++)
{
for(i=0; i {
SetPixelColor(i Wheel((i+j) & 255));
}
HAL_Delay (wait);
}
}
// Slightly different this makes the rainbow e
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14183767 2018-02-11 23:48 ESP8266\ESP8266获取网络天气适配战舰V3.zip
文件 1422138 2017-05-03 21:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\.output\eagle\debug\image\eagle.app.v6.out
文件 181756 2017-05-03 21:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\lib\libdriver.a
文件 1253 2017-05-03 21:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\Adafruit_NeoPixel.d
文件 29288 2017-05-03 21:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\Adafruit_NeoPixel.o
文件 980 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\gpio16.d
文件 4964 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\gpio16.o
文件 1456 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\hal_key.d
文件 17212 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\hal_key.o
文件 1010 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\hw_timer.d
文件 8188 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\hw_timer.o
文件 1020 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\i2c_master.d
文件 19904 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\i2c_master.o
文件 1217 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\key.d
文件 14588 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\key.o
文件 1426 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\spi.d
文件 16908 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\spi.o
文件 1279 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\spi_overlap.d
文件 27988 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\spi_overlap.o
文件 1167 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\uart.d
文件 40236 2017-05-01 15:04 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\.output\eagle\debug\obj\uart.o
文件 5702 2017-05-04 12:20 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\Adafruit_NeoPixel.c
文件 1397 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\gpio16.c
文件 9724 2016-09-29 14:37 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\hal_key.c
文件 4285 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\hw_timer.c
文件 9449 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\i2c_master.c
文件 6277 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\key.c
文件 1446 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\Makefile
文件 18483 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\spi.c
文件 14016 2016-07-14 16:30 ESP8266\SoC_ESP8266_WS2812B_SmartLEDs\SoC_ESP8266_WS2812B_SmartLEDs\app\driver\spi_overlap.c
............此处省略187个文件信息
- 上一篇:锁相环技术(第3版)-完整中文版
- 下一篇:HOG测试程序
相关资源
- Arduino esp8266 wifi库 2.4.2版本
- ESP8266远程控制应用+APP源码.
- ZigBeeGateway_DHT11.rar
- esp8266混乱模式实现WIFI探针
- stm32_MCU移植接入机智云新
- esp8266-2.7.4.zip
- STM32接入机智云—点灯教程
- STM32F103C8T6 单片机 ESP8266 12F接入机智云
- bbs.tar.gz论坛开发代码
- MQTT协议连接OneNet服务器
- ESP8266—NON_OS_SDK开发的例程
- 基于STM32/ESP8266/DSB10B20的温度采集程序
- ESP8266远程控制应用+APP源码
- esp8266 V2.5.2--arduino IDE添加esp8266开发板
- ESP8266获取网络天气.zip
- 09HAL_WIFI_01PassThrough.rar
- STM32F407+ESP8266 阿里云Iot.zip
- STM32CubeMX通过ESP8266 AT指令MQTT上阿里云
- ESP8266+5V+WiFi继电器智能物联网模块+智
- Arduino IDE for esp 8266开发版最新官方安
- 机智云开源框架智能家居系统
- ESP8266开发板烧录AT固件.rar
- ESP8266wifi模块资料
- Arduino+ESP8266库文件
- esp8266技小新教程2.zip
- esp8266技小新教程1.zip
- esp8266-2.7.2 离线安装包.zip
- 单片机控制ESP8266点亮LED小灯
- nodemcu for esp8266 ,lua语言开发
- stm32控制esp8266访问web
评论
共有 条评论