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:f1c2852c4f57, committed 2010-02-16
- Comitter:
- okano
- Date:
- Tue Feb 16 04:58:22 2010 +0000
- Commit message:
Changed in this revision
| 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Feb 16 04:58:22 2010 +0000
@@ -0,0 +1,35 @@
+/*
+ * mbed + LPCXpresso_baseboard demo code
+ *
+ * This code has been made for a training session.
+ *
+ * With this code, the mbed drives PCA9532 to control 16 LEDs.
+ *
+ * Copyright (c) 2010 NXP Semiconductors Japan
+ * Released under the MIT License: http://mbed.org/license/mit
+ *
+ * revision 1.0 16-Feb-2010 1st release
+ */
+
+#include "mbed.h"
+
+I2C i2c( p28, p27 ); // sda, scl
+
+const int PCA9532_addr = 0xC0; // define the I2C Address
+
+const char data[2][5] = {
+ { 0x16, 0x00, 0x00, 0x00, 0x00 },
+ { 0x16, 0x55, 0x55, 0x55, 0x55 }
+ };
+
+int main() {
+
+ char i = 0;
+
+ while ( 1 )
+ {
+ i2c.write( PCA9532_addr, data[ i++ & 0x1 ], 5 );
+ wait( 0.5 );
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Feb 16 04:58:22 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0