Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:c68ff8dad58d, committed 2015-11-14
- Comitter:
- sweilz
- Date:
- Sat Nov 14 14:29:00 2015 +0000
- Commit message:
- EEPROM 24LC64
Changed in this revision
--- /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
--- /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);
+ */
+
+
+}
--- /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