LittleC
技术学习记录
技术交流学习

NodeMcu Esp8266试玩

根据readme里面的操作

装上相应的包,就能连上了

调调速度

blink样例能跑,很满意(

Linux

serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Upload error: Error: 2 UNKNOWN: uploading error: uploading error: exit status 1

运行如下命令

sudo chmod a+rw /dev/ttyUSB0

ws2812b

测试下ws2812b的设备,左侧接GGND, VV5V, 右侧接一个D1到IN,写点测试代码,就能跑了

#include "FastLED.h"
#define NUM_LEDS 64
#define BRI 100
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, D1, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(BRI);
}

void loop() {
  for(int dot = 0; dot < NUM_LEDS; dot++) { 
    leds[dot] = 0x1f1e33;
    FastLED.show();
    leds[dot] = CRGB::Black;
    delay(30);
  }
}

接个oled屏

参考链接:https://randomnerdtutorials.com/esp8266-0-96-inch-oled-display-with-arduino-ide/

一点改动:虽然我是128×64的屏幕,但是这个地址不一样,用0x3C就可以了

#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32

文档里也有提到:The I2C address for the OLED display we are using is 0x3C. However, yours may be different. So, make sure you check your display I2C address using an I2C scanner sketch.

试一试

display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.println(F("Hello world!"));
display.display();
图片来源:https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/

技术交流学习

NodeMcu Esp8266试玩
根据readme里面的操作 装上相应的包,就能连上了 调调速度 blink样例能跑,很满意( Linux serial.serialutil.SerialException: [Errno 13] could no…
扫描二维码继续阅读
2021-06-11