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.
Dependencies: SX1276Lib AdaFruit_RGBLCD MCP23017 mbed
Fork of AdaFruit_RGBLCD by
main.cpp
- Committer:
- vtraveller
- Date:
- 2014-08-02
- Revision:
- 2:ac3b92ebf17a
- Parent:
- 1:45e2e7c0754d
- Child:
- 3:ed09f95739df
File content as of revision 2:ac3b92ebf17a:
#include "mbed.h" #include "MCP23017.h" DigitalOut myled1(LED1); DigitalOut myled2(LED2); Serial pc(USBTX, USBRX); I2C i2c(I2C_SDA, I2C_SCL); MCP23017 mcp23017 = MCP23017(i2c, 0x40); int main() { pc.printf("Hello World\n\r"); // I2C init i2c.frequency(400000); // Port A is databus - Output mcp23017.direction(PORT_A, PORT_DIR_OUT); // Port B is controlbus - Output mcp23017.direction(PORT_B, PORT_DIR_OUT); myled2 = 1; pc.printf("MPC Init done\n\r"); while(1) { myled1 = 1; mcp23017.write(PORT_A, 0xFF); mcp23017.write(PORT_B, 0xFF); wait(0.1); myled1 = 0; mcp23017.write(PORT_A, 0x00); mcp23017.write(PORT_B, 0x00); wait(0.1); pc.printf("*"); } }