feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
/********************************************************
** Download from: **
** http://www.arduino-projekte.de **
** **
** Based on Code from: **
** http://arduino.cc/playground/ **
** **
** Released into the public domain. **
********************************************************/
#include <AH_24Cxx.h>
#include <Wire.h>
#define AT24C01 0
#define AT24C02 1
#define AT24C04 2
#define AT24C08 3
#define AT24C16 4
#define AT24C32 5
#define AT24C64 6
#define AT24C128 8
#define AT24C256 9
//Initialisation
int data;
#define BUSADDRESS 0x00
#define EEPROMSIZE 2048 //AT24C16 2048byte
AH_24Cxx ic_eeprom = AH_24Cxx(AT24C16, BUSADDRESS);
void setup(){
Serial.begin(9600);
Wire.begin();
Serial.println("Write data");
for(int i = 0; i < 10; i++) {
data = i;
ic_eeprom.write_byte(i,data);
delay(100);
}
}
void loop(){
Serial.println("Read data");
for (int i=0;i<EEPROMSIZE;i++){
Serial.print("pos. ");
Serial.print(i);
Serial.print(": ");
Serial.println(ic_eeprom.read_byte(i));
delay(1000);
}
}