27753浏览
楼主: 驴友花雕

[ESP8266/ESP32] 最像Arduino Uno的ESP32开发板之WeMos D1 R32

[复制链接]

驴友花雕  中级技神
 楼主|

发表于 2021-8-9 09:16:58

实验场景动态图  

图  最像Arduino Uno的ESP32开发板之WeMos D1 R32图1






回复

使用道具 举报

郑同学  学徒

发表于 2021-8-10 08:33:53

你好,我最近刚从淘宝入手这么一块板子,可是淘宝只提供安装环境,不提供教程,想请问题主是怎么学习的?可以的话希望可以交流学习
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-8-10 10:21:48

郑同学 发表于 2021-8-10 08:33
你好,我最近刚从淘宝入手这么一块板子,可是淘宝只提供安装环境,不提供教程,想请问题主是怎么学习的?可 ...

这板子挺强大的,我也是头回接触,我的笨办法就是发帖子,多做实验,多尝试
回复

使用道具 举报

郑同学  学徒

发表于 2021-8-11 22:54:11

驴友花雕 发表于 2021-8-10 10:21
这板子挺强大的,我也是头回接触,我的笨办法就是发帖子,多做实验,多尝试 ...

看到题主你做了挺多试验,想请问几个点,我想此板子和PC通讯,一个是WIFI一个是蓝牙,但我发现二者都行不通,WIFI连接wifi之后板子无法访问网页总是超时,而采用蓝牙时,无法用Python实现,不知道题主有何建议吗?
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-8-12 06:44:23

本帖最后由 驴友花雕 于 2021-8-12 06:45 编辑
郑同学 发表于 2021-8-11 22:54
看到题主你做了挺多试验,想请问几个点,我想此板子和PC通讯,一个是WIFI一个是蓝牙,但我发现二者都行不 ...

不太了解你的相关基础与专业经历

以我的经验来说,肯定是先从简单的开始,比如没有见过的传感器模块,上手后会用放大镜查看芯片型号,再去网上查询相关的资料,争取有个大致的了解,然后是关心适合的平台,编程控制等;另如上手一块开发板,会根据型号,先去搜集其资料包,然后尝试建立简单的开发环境,Hello World,再实验一些基础性的例程,慢慢了解与熟悉。凡事有过程,这里以为一步一步来,循序渐进会为稳妥一些,仅供参考。
回复

使用道具 举报

皮莱仕  学徒

发表于 2021-11-11 15:54:18

博主你好,为什么我用这块板子配置好ESP32环境后,不能使用ESP32舵机库,说库和这块板子不兼容,这块板子不是基于ESP32的吗?为什么不能使用ESP32舵机库
回复

使用道具 举报

皮莱仕  学徒

发表于 2021-11-11 15:56:13

具体情况如下
ThuNovember-202111117872..png
ThuNovember-202111111176..png
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-11-14 14:36:43

皮莱仕 发表于 2021-11-11 15:54
博主你好,为什么我用这块板子配置好ESP32环境后,不能使用ESP32舵机库,说库和这块板子不兼容,这块板子不 ...

ESP32也有不同板型,有一定的区别,您用的什么板子?
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 09:22:57

  【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  实验一百七十七:Wemos D1 R32 ESP32开发板
  项目之四十一:绿色快闪点亮8X32位WS2812B屏

  1. /*
  2.   【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  3.   实验一百七十七:Wemos D1 R32 ESP32开发板
  4.   项目之四十一:绿色快闪点亮8X32位WS2812B屏
  5. */
  6. #include <Adafruit_NeoPixel.h>
  7. #define PIN 23
  8. #define MAX_LED 256
  9. int val = 0;
  10. Adafruit_NeoPixel strip = Adafruit_NeoPixel( MAX_LED, PIN, NEO_RGB + NEO_KHZ800 );
  11. void setup() {
  12.   strip.setBrightness(50);
  13.   strip.begin();
  14.   strip.show();
  15. }
  16. void loop() {
  17.   uint8_t i, a = 0;
  18.   uint32_t color = strip.Color(160, 10, 10);
  19.   while (a < 257)
  20.   {
  21.     for (i = 0; i < 255; i++)
  22.     {
  23.       if (i == a) strip.setPixelColor(i, color);
  24.       else strip.setPixelColor(i, 0);
  25.     }
  26.     strip.show();
  27.     delay(2);
  28.     a++;
  29.   }
  30. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 09:29:02

实验场景图  动态图

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 09:32:09

实验场景图

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 10:02:41

  【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  实验一百七十七:Wemos D1 R32 ESP32开发板
  项目之四十二:WS2812FX库最简单的点亮形式

  1. /*
  2.   【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  3.   实验一百七十七:Wemos D1 R32 ESP32开发板
  4.   项目之四十二:WS2812FX库最简单的点亮形式
  5. */
  6. #include <WS2812FX.h> //导入库
  7. #define LED_COUNT 256 //WS2812B LED数量
  8. #define LED_PIN    23 //WS2812B LED接脚
  9. WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
  10. void setup() {
  11.   ws2812fx.init(); //初始化
  12.   ws2812fx.setBrightness(35); //设置亮度(0-255),可以控制总电流(重要!)
  13.   ws2812fx.setSpeed(100); // 设置速度
  14.   ws2812fx.setMode(FX_MODE_FIREWORKS_RANDOM);// 设置模式(内置63种模式)
  15.   ws2812fx.start(); //启动
  16. }
  17. void loop() {
  18.   ws2812fx.service(); //循环运行
  19. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 10:29:27

实验场景图

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 10:31:42

实验场景图  动态图

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 11:06:39

声音模块,使用性价比更高的MAX4466声音传感器

MAX4466模块特点
电源电压:+2.4V至+5.5V(可直接接STM/ARDUNIO/树莓派等开发板)
电源抑制比:112dB
共模抑制比:126dB
AVOL:125dB(RL = 100kΩ) 轨到轨输出
静态电源电流:24μA
增益带宽:600kHz
尺寸:20.8mm x 13.8mm x 7.5mm/0.8 x 0.5 x 0.3inch

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 13:42:50

  【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  实验一百七十七:Wemos D1 R32 ESP32开发板
  项目之四十三:esp32 max4466 简易串口读取声级

  1. /*
  2.   【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  3.   实验一百七十七:Wemos D1 R32 ESP32开发板
  4.   项目之四十三:esp32 max4466 简易串口读取声级
  5. */
  6. void setup() {
  7.   Serial.begin(9600);
  8. }
  9. void loop() {
  10.   int micin;
  11.   micin = analogRead(39);
  12.   Serial.println(micin);
  13.   delay(300);
  14. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 13:44:26

实验串口返回情况

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 13:46:36

打开Arduino IDE——工具——串口绘图器,查看实验波形

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 13:48:46

实验串口绘图器返回情况

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 15:07:22

ESP32 与 Arduino 模拟输入的区别注意事项。

使用支持 ADC 的 GPIO 引脚
读数范围从 0 到 4095(Arduino 为 0 到 1023)
读取电压范围0~3.3V(Arduino为0~5V)
但是,读取范围和分辨率可以通过默认设置来更改。此外,它似乎从 3.2V 左右返回 4095 的值(参考:ESP32 ADC)

由于读数电压高达3.3V,麦克风供电采用3.3V。接线示例如下。请注意,ESP32 有很多变体,其中许多具有不同的管脚布局,因此管脚布局不一定是下面的。

最像Arduino Uno的ESP32开发板之WeMos D1 R32图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2022-11-16 15:23:54

  【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  实验一百七十七:Wemos D1 R32 ESP32开发板
  项目之四十四:esp32 NeoPixel 灯板测试程序

  1. /*
  2.   【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  3.   实验一百七十七:Wemos D1 R32 ESP32开发板
  4.   项目之四十四:esp32 NeoPixel 灯板测试程序
  5. */
  6. #include <Adafruit_NeoPixel.h>
  7. // Which pin on the Arduino is connected to the NeoPixels?
  8. // On a Trinket or Gemma we suggest changing this to 1:
  9. #define LED_PIN    23
  10. // How many NeoPixels are attached to the Arduino?
  11. #define LED_COUNT 256
  12. // Declare our NeoPixel strip object:
  13. Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
  14. // Argument 1 = Number of pixels in NeoPixel strip
  15. // Argument 2 = Arduino pin number (most are valid)
  16. // Argument 3 = Pixel type flags, add together as needed:
  17. //   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
  18. //   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
  19. //   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
  20. //   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
  21. //   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
  22. // setup() function -- runs once at startup --------------------------------
  23. void setup() {
  24.   // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  25.   // Any other board, you can remove this part (but no harm leaving it):
  26.   //#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  27.   //clock_prescale_set(clock_div_1);
  28.   //#endif
  29.   // END of Trinket-specific code.
  30.   strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  31.   strip.show();            // Turn OFF all pixels ASAP
  32.   strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
  33. }
  34. // loop() function -- runs repeatedly as long as board is on ---------------
  35. void loop() {
  36.   // Fill along the length of the strip in various colors...
  37.   colorWipe(strip.Color(255,   0,   0), 50); // Red
  38.   colorWipe(strip.Color(  0, 255,   0), 50); // Green
  39.   colorWipe(strip.Color(  0,   0, 255), 50); // Blue
  40.   // Do a theater marquee effect in various colors...
  41.   theaterChase(strip.Color(127, 127, 127), 50); // White, half brightness
  42.   theaterChase(strip.Color(127,   0,   0), 50); // Red, half brightness
  43.   theaterChase(strip.Color(  0,   0, 127), 50); // Blue, half brightness
  44.   rainbow(10);             // Flowing rainbow cycle along the whole strip
  45.   theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant
  46. }
  47. // Some functions of our own for creating animated effects -----------------
  48. // Fill strip pixels one after another with a color. Strip is NOT cleared
  49. // first; anything there will be covered pixel by pixel. Pass in color
  50. // (as a single 'packed' 32-bit value, which you can get by calling
  51. // strip.Color(red, green, blue) as shown in the loop() function above),
  52. // and a delay time (in milliseconds) between pixels.
  53. void colorWipe(uint32_t color, int wait) {
  54.   for (int i = 0; i < strip.numPixels(); i++) { // For each pixel in strip...
  55.     strip.setPixelColor(i, color);         //  Set pixel's color (in RAM)
  56.     strip.show();                          //  Update strip to match
  57.     delay(10);                           //  Pause for a moment
  58.   }
  59. }
  60. // Theater-marquee-style chasing lights. Pass in a color (32-bit value,
  61. // a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms)
  62. // between frames.
  63. void theaterChase(uint32_t color, int wait) {
  64.   for (int a = 0; a < 10; a++) { // Repeat 10 times...
  65.     for (int b = 0; b < 3; b++) { //  'b' counts from 0 to 2...
  66.       strip.clear();         //   Set all pixels in RAM to 0 (off)
  67.       // 'c' counts up from 'b' to end of strip in steps of 3...
  68.       for (int c = b; c < strip.numPixels(); c += 3) {
  69.         strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
  70.       }
  71.       strip.show(); // Update strip with new contents
  72.       delay(10);  // Pause for a moment
  73.     }
  74.   }
  75. }
  76. // Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
  77. void rainbow(int wait) {
  78.   // Hue of first pixel runs 5 complete loops through the color wheel.
  79.   // Color wheel has a range of 65536 but it's OK if we roll over, so
  80.   // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time
  81.   // means we'll make 5*65536/256 = 1280 passes through this outer loop:
  82.   for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) {
  83.     for (int i = 0; i < strip.numPixels(); i++) { // For each pixel in strip...
  84.       // Offset pixel hue by an amount to make one full revolution of the
  85.       // color wheel (range of 65536) along the length of the strip
  86.       // (strip.numPixels() steps):
  87.       int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
  88.       // strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
  89.       // optionally add saturation and value (brightness) (each 0 to 255).
  90.       // Here we're using just the single-argument hue variant. The result
  91.       // is passed through strip.gamma32() to provide 'truer' colors
  92.       // before assigning to each pixel:
  93.       strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
  94.     }
  95.     strip.show(); // Update strip with new contents
  96.     delay(10);  // Pause for a moment
  97.   }
  98. }
  99. // Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames.
  100. void theaterChaseRainbow(int wait) {
  101.   int firstPixelHue = 0;     // First pixel starts at red (hue 0)
  102.   for (int a = 0; a < 30; a++) { // Repeat 30 times...
  103.     for (int b = 0; b < 3; b++) { //  'b' counts from 0 to 2...
  104.       strip.clear();         //   Set all pixels in RAM to 0 (off)
  105.       // 'c' counts up from 'b' to end of strip in increments of 3...
  106.       for (int c = b; c < strip.numPixels(); c += 3) {
  107.         // hue of pixel 'c' is offset by an amount to make one full
  108.         // revolution of the color wheel (range 65536) along the length
  109.         // of the strip (strip.numPixels() steps):
  110.         int      hue   = firstPixelHue + c * 65536L / strip.numPixels();
  111.         uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB
  112.         strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
  113.       }
  114.       strip.show();                // Update strip with new contents
  115.       delay(10);                 // Pause for a moment
  116.       firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames
  117.     }
  118.   }
  119. }
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail