📄 复件 eeprom.c
字号:
#include <avr/io.h>
#include <util/delay.h>
#include<avr/wdt.h>
#include <avr/eeprom.h>
//char EEMEM a ,b;
int main(void)
{
/*
unsigned int temp3;
unsigned char temp1,temp2; /*定义变量*/
unsigned char buffer[10]; /*定义数组*/
unsigned char buf[]="10101100"; /*定义字符串*/
//eeprom_busy_wait();
eeprom_write_byte ((unsigned char *)0x05,'f'); /*单字符写入到0x10,注意是单引号*/
// eeprom_busy_wait();
//temp1 =eeprom_read_byte((unsigned char *)0x05); //读出一个字节
// eeprom_busy_wait();
eeprom_write_block((unsigned char *)buf,(unsigned char *)0x20,6); /*写字符串到0x20*/
// eeprom_busy_wait();
//eeprom_read_block(buffer,(unsigned char *)0x20,6); //连续读入一串数据
unsigned int tt=0x5213;
eeprom_write_word((uint16_t *)9,tt); //写一个字
//temp3 =eeprom_read_word((unsigned int *)6); //读一个字
while(1) ;
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -