EEPROM 24LC64

Dependencies:   eeprom mbed

Files at this revision

API Documentation at this revision

Comitter:
sweilz
Date:
Sat Nov 14 14:29:00 2015 +0000
Commit message:
EEPROM 24LC64

Changed in this revision

eeprom.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c68ff8dad58d eeprom.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eeprom.lib	Sat Nov 14 14:29:00 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/FRA221_2015/code/eeprom/#df82ebf4be54
diff -r 000000000000 -r c68ff8dad58d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 14 14:29:00 2015 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "eeprom.h"
+//------------------------------------
+// Hyperterminal configuration
+// 9600 bauds, 8-bit data, no parity
+//------------------------------------
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalOut myled(LED1);
+
+EEPROM mem(I2C_SDA, I2C_SCL,0);
+
+int main()
+{
+
+    //Int เขียนและอ่าน
+    /*
+    int w_int = 1231101;
+    int r_int;
+    mem.write(0x0000,&w_int,4);//เขียน
+    mem.read(0x0000,&r_int,4);//อ่าน
+    pc.printf("%d\n",r_int);
+    */
+
+    //Char เขียนและอ่าน
+    /*
+    char w_str[20]="Liews Wuttipat";
+    char r_str[20];
+    mem.write(0x0000, w_str,14);//เขียน
+    mem.read(0x0000, r_str,14);//อ่าน
+    pc.printf("%s\n", r_str);
+    */
+
+    //Float เขียนและอ่าน
+    /*
+    float w_flt = 123.923456;
+    float r_flt;
+    mem.write(0, &w_flt,4);//เขียน
+    mem.read(0,&r_flt,4);//อ่าน
+    pc.printf("%f\n",r_flt);
+    */
+
+
+}
diff -r 000000000000 -r c68ff8dad58d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Nov 14 14:29:00 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file