Arduino control Eeprom by IIC method of using device address in Arduino
参考:
1.https://www.arduino.cc/
2.https://www.arduino.cc/reference/en/
3.https://www.arduino.cc/en/Reference/Wire
4.https://www.arduino.cc/en/Reference/WireRead
5.https://www.arduino.cc/en/Reference/WireWrite
6.https://github.com/settings/installations
写入方法:
void writeway(int address , int val)
{
Wire.beginTransmission(0x50); // transmit to device #44 (0x2c) // eeprom device address 0x50
// device address is specified in datasheet
Wire.write(address);
Wire.write(val); // sends value byte
Wire.endTransmission(); // stop transmitting
val++; // increment value
if(val == 64) // if reached 64th position (max)
{
val = 0; // start over from lowest value
}
delay(5);
}
读取方法:
int readway (int address)
{
Wire.beginTransmission(0x50); // transmit to device #44 (0x2c) // eeprom device address 0x50 // device address is specified in datasheet
Wire.write(address); // sends value byte
Wire.endTransmission(); // stop transmitting
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
while(Wire.available()) // slave may send less than requested
{
// char c = Wire.read(); // receive a byte as character
// Serial.print(c); // print the character
}
return Wire.read();
}
Arduino control Eeprom by IIC method of using device address in Arduino的更多相关文章
- Arduino Wire.h(IIC/ I2C)语法
转自:https://www.cnblogs.com/1996jiwei/p/6561681.html 本文转自上面链接,版权请直接参考原链接. 最近在用I2C进行通信交流,发现有两种方法的头文件需要 ...
- Arduino Wire.h(IIC)库函数详解
此库中包含 1 Wire.begin() 2 Wire.requestFrom() 3 Wire.beginTransmission() 4 Wire.endTransmission() 5 Wire ...
- Arduino 中 EEprom 写入读取清除
转自:https://www.arduino.cn/thread-1157-1-1.html EEPROM (Electrically Erasable Programmable Read-Only ...
- IIC协议建模——读写EEPROM
案例采用明德扬设计思想完成.IIC协议是非常常用的接口协议,在电子类岗位招聘要求中经常出现它的身影.关于IIC协议这里只做简要介绍,详细信息请自行百度或查阅相关Datasheet,网上资料非常多.该篇 ...
- 51单片机学习笔记(郭天祥版)(9)——IIC、EEPROM
IIC是两根线,单总线,只有一根数据线,发送数据和读取收据都是一根线,像我们之前学的AD.DA都是许多线,许多线的话,这样做系统可以少浪费资源,少浪费控制IO口的资源,这种并行的处理速度快.所以线越多 ...
- Arduino学习笔记⑦ EEPROM断电保存数据
1.前言 EEPROM,叫做电可擦可编程可读寄存器(是不是觉得好官方,不知道是什么鬼?反正我也一脸懵逼),只需要知道这是一种断电后数据不会丢失的存储设备,可以用来应对需要做记录做保存的场合.简 ...
- USB小白学习之路(6) IIC EEPROM读取解析
IIC EEPROM读取解析 1. 编译错误处理(这里可以忽略) 在解压包解压了程序后,直接编译,出现如下错误. *** WARNING L14: INCOMPATIBLE MEMORY MODEL ...
- IIC读写AT24C02代码2——串口命令控制多页读写
通过串口输入 R .W 进行控制程序读写IIC设备.波特率9600bps,晶振115200HZ. main.c /*------------------------------------------ ...
- ESP8266开发之旅 进阶篇② 闲聊Arduino IDE For ESP8266烧录配置
授人以鱼不如授人以渔,目的不是为了教会你具体项目开发,而是学会学习的能力.希望大家分享给你周边需要的朋友或者同学,说不定大神成长之路有博哥的奠基石... QQ技术互动交流群:ESP8266&3 ...
随机推荐
- Kafka与RabbitMQ区别
RabbitMQ 和 Kafka 的显著差异 RabbitMQ 是一个消息代理,但是 Apache Kafka 是一个分布式流式系统.好像从语义上就可以看出差异,但是它们内部的一些特性会影响到我们是否 ...
- Python基础(闭包函数、装饰器、模块和包)
闭包函数 格式: def 函数名1(): def 函数名2(): 变量 = 值 return 变量 return 函数名2 func = 函数名1() key = func()
- 【Maven】Mac操作系统下安装配置maven环境变量
1.下载maven 下载地址:http://maven.apache.org/download.cgi 2.解压设置maven本地地址解压后 我放在 /Users/david/developer/ap ...
- python执行gradle脚本
import os import shutil import subprocess #拷贝文件 def copyFile(srcFile, dstFile): #检查源文件是否存在 if not os ...
- 面向嵌入式的JavaScript引擎
https://jerryscript.net/ https://duktape.org/ https://github.com/ialex32x/duktape-unity https://gith ...
- react-native 常用命令
创建项目 react-native init AwesomeProject //AwesomeProject是项目名 启动 Node.js web server react-native start ...
- 烂大街的 Spring 循环依赖问题,你觉得自己会了吗
文章已收录在 GitHub JavaKeeper ,N 线互联网开发.面试必备技能兵器谱,笔记自取. 微信搜「 JavaKeeper 」程序员成长充电站,互联网技术武道场.无套路领取 500+ 本电子 ...
- centos下安装mongodb和php的mongo扩展
安装MongoDB 1.下面安装MongoDB,先下载: cd /usr/src wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2 ...
- 在CentOS 7服务器中使用Jexus发布.net core webapi
环境: 服务器:CentOS 7 64位 .net core 2.1 Jexus独立版 官网:https://www.jexus.org/ 按照官网安装独立版命令:curl https://jexus ...
- JVM-STW-stop the world
Stop The World Stop一the一World,简称STW,指的是Gc事件发生过程中,会产生应用程序的停顿.停顿产生时整个应用程序线程都会被暂停,没有任何响应,有点像卡死的感觉,这个停顿称 ...