Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/facts-engineering/at24mac_eeprom
Arduino library for the AT24MAC402/602 chip
https://github.com/facts-engineering/at24mac_eeprom
Last synced: about 16 hours ago
JSON representation
Arduino library for the AT24MAC402/602 chip
- Host: GitHub
- URL: https://github.com/facts-engineering/at24mac_eeprom
- Owner: facts-engineering
- License: mit
- Created: 2023-11-27T21:28:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T21:32:47.000Z (about 1 year ago)
- Last Synced: 2024-11-06T23:04:11.852Z (about 2 months ago)
- Language: C++
- Size: 6.84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AT24MAC EEPROM Arduino Library
Arduino library for the AT24MAC402/602 chip. These microchips have build in MAC address and serial number.
Memory size for both parts is 256 bytes.Use the Arduino Library Manager to install.
## Example
Here is a simple example which shows the capabilities of the library
```cpp
#includeuint8_t mac[6];
void setup() {
Serial.begin(9600);
while(!Serial);
//Read and print MAC address
EEPROM.readMacAddress(mac);
Serial.print("MAC address: ");
for(uint8_t i = 0; i < 6; i++){
Serial.print(mac[i], HEX);
Serial.print(" ");
}
Serial.println("");
//Write 8 bytes and read them back
for (int i = 0 ; i < 8 ; i++) {
EEPROM.write(i, 100 + i);
}
for (int i = 0 ; i < 8 ; i++) {
Serial.print("Byte ");
Serial.print(i);
Serial.print(": ");
Serial.println(EEPROM.read(i));
}
}void loop() {
}
```