lu sheng / Mbed 2 deprecated Nucleo_PCF8574_led_iic

Dependencies:   PCF8574 mbed

Files at this revision

API Documentation at this revision

Comitter:
anywill
Date:
Thu Oct 27 05:06:22 2016 +0000
Commit message:
PCF8574

Changed in this revision

PCF8574.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 8cb68b6fa38d PCF8574.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCF8574.lib	Thu Oct 27 05:06:22 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/bborredon/code/PCF8574/#6d75da25c179
diff -r 000000000000 -r 8cb68b6fa38d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 27 05:06:22 2016 +0000
@@ -0,0 +1,29 @@
+
+#include "mbed.h"
+#include "PCF8574.h"
+
+PCF8574 io(D14,D15,0x70);//iic 设置:D14 SDA,D15 SCL
+
+int main()
+{
+   while(1) 
+    {
+     io.write(0x0);
+        if ((io.read()) == 16) 
+        {
+         io.write(0x01);
+        }
+        else if((io.read()) == 32)
+        {
+         io.write(0x02);
+        }
+        else if((io.read()) == 64)
+        {
+         io.write(0x04);
+        }
+        else if((io.read()) == 128)
+        {
+         io.write(0x08);
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 8cb68b6fa38d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 27 05:06:22 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file