LPC General Purpose Shield OM13082

The LPC General Purpose Shield Board has been designed to complement NXP’s range of LPCXpresso MCU development boards by providing easy access to several commonly used peripherals. The LPC General Purpose Shield plugs into the top-side expansion connector

Hello World

Import programOM13082-LM75B

Example program for LPC General Purpose Shield using the LM75 temperature sensor

Library

Import libraryLM75B

A feature complete driver for the LM75B temperature sensor from NXP.

Notes

1. JoyStick

An example program to scan 5-way JoyStick button

Import program

00001 #include "mbed.h"
00002 #include "PCAL9555.h"
00003 
00004 PCAL9555    gpio_exp(SDA, SCL);
00005 GpioBusIn   joystick(gpio_exp, X0_0, X0_1, X0_2, X0_3, X0_4);
00006 Serial      pc(USBTX, USBRX);
00007 
00008 enum key_num {
00009     Key_Up     = (1 << X0_4),
00010     Key_Down   = (1 << X0_0),
00011     Key_Right  = (1 << X0_3),
00012     Key_Left   = (1 << X0_2),
00013     Key_Center = (1 << X0_1),
00014 };
00015 
00016 int main()
00017 {
00018     while(1) {
00019         int keys = joystick.read();
00020         if ((keys & Key_Up) == 0)
00021             pc.printf("Up\n");
00022         if ((keys & Key_Down) == 0)
00023             pc.printf("Down\n");
00024         if ((keys & Key_Right) == 0)
00025             pc.printf("Right\n");
00026         if ((keys & Key_Left) == 0)
00027             pc.printf("Left\n");
00028         if ((keys & Key_Center) == 0)
00029             pc.printf("Center\n");
00030         wait(0.3);
00031     }
00032 }

Import libraryPCAL955x

The PCAL9555, PCAL9554 series is a low-voltage 16-bit/8-bit General Purpose Input/Output (GPIO) expander with interrupt. This conponent library is compatible to basic operation os GPIO expanders: PCAL9555, PCA9555, PCA9535, PCA9539, PCAL9554, PCA9554 and PCA9538. On addition to this, this library is including mbed-SDK-style APIs. APIs that similar to DigitaiInOut, DigitalOut, DigitalIn, BusInOUt, BusOut and BusIn are available.

2. LED blinky

Import program

00001 #include "mbed.h"
00002 #include "PCAL9555.h"
00003  
00004 PCAL9555    gpio_exp(SDA, SCL);
00005 GpioBusOut  leds(gpio_exp, X1_4, X1_5, X1_6, X1_7);
00006  
00007 enum key_num {
00008     OM13082_LD1 = (1 << 0),
00009     OM13082_LD2 = (1 << 1),
00010     OM13082_LD3 = (1 << 2),
00011     OM13082_LD4 = (1 << 3),
00012 };
00013  
00014 int main()
00015 {
00016     while(1) {
00017         leds.write(0xF);
00018         wait(0.3);
00019         leds.write(~OM13082_LD1);
00020         wait(0.3);
00021         leds.write(~OM13082_LD2);
00022         wait(0.3);
00023         leds.write(~OM13082_LD3);
00024         wait(0.3);
00025         leds.write(~OM13082_LD4);
00026         wait(0.3);
00027     }
00028 }
00029  

Import libraryPCAL955x

The PCAL9555, PCAL9554 series is a low-voltage 16-bit/8-bit General Purpose Input/Output (GPIO) expander with interrupt. This conponent library is compatible to basic operation os GPIO expanders: PCAL9555, PCA9555, PCA9535, PCA9539, PCAL9554, PCA9554 and PCA9538. On addition to this, this library is including mbed-SDK-style APIs. APIs that similar to DigitaiInOut, DigitalOut, DigitalIn, BusInOUt, BusOut and BusIn are available.

3. Potentiometer

Import program

00001 #include "mbed.h"
00002 
00003 Serial pc(USBTX, USBRX);
00004 
00005 AnalogIn pot(A3);
00006 
00007 int main()
00008 {
00009     while(1) {
00010         pc.printf("Potentiometer = %.2f\n", (float)pot);
00011         wait(0.3);
00012     }
00013 }

4. 128x64 LCD Module

Import programOM13082-LCD

Example program for LPC General Purpose Shield using the 128x64 LCD module

Import libraryST7567

LPC General Purpose Shield (OM13082) LCD module library


You need to log in to post a discussion