2 Star 4 Fork 4

陈俊鹏 / 树莓派 4B iic oled

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Unlicense

SSD1306 i2c 屏幕在 Raspberry PI上的应用


基于Adafruit SSD1306 Arduino库。有些功能来自adagf$

在Raspberry Pi 4B 上,连接了一个0.96寸上黄下蓝的OLED(128x64)上测试


这是一个基于SSD1306驱动程序的单色oled库

使用的是树莓派的i2c接口 接线方法:

GND-------GND----------任意0V

VCC-------3.3V---------任意3.3V

SDA-------SDA1---------3号引脚

SCK-------SCK1---------5号引脚


1安装前提

1.1.1打开树莓派 iic接口

sudo raspi-config

sudo apt-get install wiringPi

1.1.2或

wget https://project-downloads.drogon.net/wiringpi-latest.deb`

sudo apt install ./wiringpi-latest.deb

1.2检查

gpio –v

1.3查看gpio 引脚

gpio readall

1.4安装iic工具

sudo apt-get install i2c-tools

1.5查看iic 设备是否连接

sudo i2cdetect -y 1

2如果你想编译它

2.1方法一

sh ./make.sh

2.2方法二

gcc oled.c ssd1306_i2c.c -lwiringPi -o oled

3如果你想运行它

3.1方法一

./oled

3.2方法二

sudo ./oled

4添加开机启动的方法

vim /etc/rc.local

在exit()之前添加

nohup (编译好oled文件的全名--带路径的) &
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org>

简介

用树莓派点亮i2c屏,方便查看ip和树莓派的一些信息! 展开 收起
C 等 2 种语言
Unlicense
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/langhun1996/raspberry-pie.git
git@gitee.com:langhun1996/raspberry-pie.git
langhun1996
raspberry-pie
树莓派 4B iic oled
master

搜索帮助