步骤1: 硬件准备 确保你拥有 Raspberry Pi 或其他兼容的微控制器,以及 Adafruit SSD1306 OLED 显示模块。你可以在 Adafruit 网站上找到这些硬件。 步骤2: 安装必要的软件包 在开始编程之前,确保你的系统上安装了必要的软件。首先,需要安装 Python(通常预装在 Raspberry Pi 上)。 然后使用以下命令安装 Adafruit 库:...
这条命令将会尝试更新 pip 到最新版本。 第三步:安装 Adafruit-SSD1306 库 使用以下命令来安装 Adafruit_Python_SSD1306 库: pipinstallAdafruit-SSD1306 1. 这条命令会从 Python 包索引下载安装 Adafruit_SSD1306 库及其依赖项。 第四步:安装相关的库(如 Pillow) SSD1306 库依赖于 Pillow 库来处理图形图像,因...
二、安装adafruit-circuitpython-ssd1306 库 adafruit-circuitpython-ssd1306是基于 Python 的 OLED 库,可以用于 128×64、128×32 像素 SSD1306 芯片控制的屏幕。 使用下面的命令安装。 sudo apt-get install python3-pip 用pip 安装 adafruit-circuitpython-ssd1306 库 ...
ssd1325, ssd1331, sh1106# rev.1 users set port=0# substitute spi(device=0, port=0) below if using that interfaceserial = i2c(port=1, address=0x3C)# substitute ssd1331(...) or sh1106(...) below if using that devicedevice = sh1106(serial)#这里改ssd1306, ssd1325...
首先找到对应的仓库,这里为大家演示的是 0.96寸OLED显示屏SSD1306,那么大家可以在 Adafruit的Github上 Adafruit Github 搜索关键字 SSD1306,可以看到 Adafruit_CircuitPython_SSD1306,这就是要使用到的仓库了。当然大家如果需要,也可以搜索其他常见的模块比如dht11、mpu6050等等等等,就需要大家自行探索了。 总之更多Demo仓...
Adafruit CircuitPython driver for SSD1306 or SSD1305 OLED displays. Note that SSD1305 displays are back compatible so they can be used in-place of SSD1306 with the same code and commands. This driver implements the adafruit_framebuf interface. It is not the displayio driver for the SSD1306....
sudo python -m pip install --upgrade pip setuptools wheel sudo pip install Adafruit-SSD1306 Or alternatively: sudo python -m pip install --upgrade pip setuptools wheel git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git cd Adafruit_Python_SSD1306 sudo python setup.py install ...
例如,使用pip安装软件包adafruit-circuitpython-ssd1306: # 使用apt安装python的adafruit-circuitpython-ssd1306包 sudo pip3 install adafruit-circuitpython-ssd1306 # 使用pip list查看安装的包 pip3 list | grep adafruit-circuitpython-ssd1306 # 使用pip uninstall 卸载包 sudo pip3 uninstall adafruit-circuitpython-...
cd Adafruit_Python_SSD1306 sudo python setup.py install 先不管代码,运行个DEMO来看效果,然后再来研究细节。 打开examples目录,找到buttons.py程序,运行,看到OLED屏上的内容如下 buttons.py程序绘制一个五向摇杆图案及两个按钮图案,当用户按下按钮时,会在OLED上绘制出用户的控制效果,图中显示的是按下五向摇杆的...
使用SSD1306库驱动OLED显示屏,实时显示环境参数。 使用urequests库将数据上传到云端,实现远程监控。 六、常见问题及解决方案 在实际开发过程中,可能会遇到一些常见问题,以下是一些解决方案: 内存不足:优化代码,减少内存占用,使用更高效的数据结构。 代码调试困难:使用串口调试工具,利用print语句输出调试信息。