mbed Application Shield

The new application shield has been designed to enable the maximum number of potential experiments with Arduino form factor development boards, keeping as much in common with the mbed application board as possible.

Hello World

Import programapp-shield-LCD

LCD Demo program for mbed application shield

Library

Import libraryC12832

C12832 LCD with generic interface

Notes

Where to buy

/media/uploads/JonnyA/labelledshield.png

Feature list

  1. 128x32 Graphics LCD
  2. 5 way joystick
  3. 2 x Potentiometers
  4. Speaker, PWM Conencted
  5. 3 Axis +/1 1.5g Accelerometer
  6. RGB LED, PWM connected
  7. Temperature sensor
  8. Socket for for Xbee (Zigbee) or RN-XV (Wifi)

1. 128x32 LCD

An example program to print text and variables to the LCD

Import program

00001 #include "mbed.h"
00002 #include "C12832.h"
00003 
00004 // Using Arduino pin notation
00005 C12832 lcd(D11, D13, D12, D7, D10);
00006 
00007 int main()
00008 {
00009     int j=0;
00010     lcd.cls();
00011     lcd.locate(0,3);
00012     lcd.printf("mbed application shield!");
00013 
00014     while(true) {   // this is the third thread
00015         lcd.locate(0,15);
00016         lcd.printf("Counting : %d",j);
00017         j++;
00018         wait(1.0);
00019     }
00020 }

Import libraryC12832

C12832 LCD with generic interface

2. Joystick

An example program for the mbed application board that uses the joystick button. RGB LEDs light in sequence with up, down, left, right, and pushing the button lights them all (as a 80's computer gamer, I want to call this "fire!")

Import program

00001 #include "mbed.h"
00002 
00003 DigitalOut red_led(D5);
00004 DigitalOut blue_led(D8);
00005 DigitalOut green_led(D9);
00006 
00007 DigitalIn up(A2);
00008 DigitalIn down(A3);
00009 DigitalIn left(A4);
00010 AnalogIn right(A5);
00011 DigitalIn fire(D4);
00012 
00013 
00014 int main()
00015 {
00016 
00017     while (1) {
00018         red_led =  !up && ! fire;
00019         blue_led = !down;
00020         green_led= !left && !right;
00021     }
00022 }
00023 
00024 

3. 2 x Potentiometers

Example that prints the pot values onto the LCD screen

Import program

00001 #include "mbed.h"
00002 #include "C12832.h"
00003 
00004 C12832 lcd(D11, D13, D12, D7, D10);
00005 
00006 AnalogIn pot1 (A0);
00007 AnalogIn pot2 (A1);
00008 
00009 int main()
00010 {
00011     while(1) {
00012         lcd.cls();
00013         lcd.locate(0,3);
00014         lcd.printf("Pot 1 = %.2f", (float)pot1);
00015         lcd.locate(0,14);
00016         lcd.printf("Pot 2 = %.2f", (float)pot2);
00017         wait(0.1);
00018     }
00019 }

4. Speaker

A frequency sweep. Press the fire button to to play it again!

Import program

00001 #include "mbed.h"
00002 
00003 DigitalIn fire(D4);
00004 PwmOut spkr(D6);
00005 
00006 int main()
00007 {
00008     while (1) {
00009         for (float i=2000.0; i<10000.0; i+=100) {
00010             spkr.period(1.0/i);
00011             spkr=0.5;
00012             wait(0.02);
00013         }
00014         spkr=0.0;
00015         while(!fire) {}
00016     }
00017 }

5. 3 Axis Accelerometer

Import programapp-shield-accelerometer

Test program for the accelerometer on the app shield

Import libraryMMA7660

Library for the MMA7660 triple axis accelerometer

6. RGB LED

An example program that cycles the on board RGB LED through various colours.

Information

The RGB LED is common anode, so that "0" is on, and "1" is off. For PWM, the closer to 0.0 the brighter, the closer to 1.0 the dimmer. use (1.0 - value) to invert.

Import program

00001 #include "mbed.h"
00002 
00003 PwmOut r (D5);
00004 PwmOut g (D8);
00005 PwmOut b (D9);
00006 
00007 int main()
00008 {
00009     r.period(0.001);
00010     while(1) {
00011         for(float i = 0.0; i < 1.0 ; i += 0.001) {
00012             float p = 3 * i;
00013             r = 1.0 - ((p < 1.0) ? 1.0 - p : (p > 2.0) ? p - 2.0 : 0.0);
00014             g = 1.0 - ((p < 1.0) ? p : (p > 2.0) ? 0.0 : 2.0 - p);
00015             b = 1.0 - ((p < 1.0) ? 0.0 : (p > 2.0) ? 3.0 - p : p - 1.0);  ;  
00016             wait (0.01);
00017         }
00018     }
00019 }

7. LM75B Temperature sensor

An example program to read the current temperature from the LM75B and display it on the LCD

Import programapp-shield-LM75B

No documentation found.

Import libraryLM75B

A simply library for the LM75B I2C temperature sensor

Details

Form factor55mm x 86mm x 19mm (with mbed)
128x32 Graphics LCD, SPI InterfaceNewhaven C12332A1Z
MOSI:D11
nRESET:D12
SCK:D13
A0:D7
nCS:D10
3 Axis +/1 1.5g Accelerometer,I2C InterfaceFreescale MMA7660
SCL:SCL
SDA:SDA
Address:0x98
Temperature sensorLM75B
SCL:SCL
SDA:SDA
Address:0x90
5 way JoystickALPS SKRHADE010
Down:A3
Left:A4
Centre:D4
Up:A2
Right:A5
2 x PotentiometersIskra PNZ10ZA, 10k
Pot 1 (left) :A0
Pot 2 (right):A1
RGB LED, PWM connectedCree Inc CLV1A-FKB
Red:D5
Green:D9
Blue:D8
Speaker, PWM ConnectedMULTICOMP MCSMT-8030B-3717
D6
Xbee socketRx:D1
Tx:D0
nReset:D3
Status:D2

Design Files

The design files are as follows :

  • Eagle design files (.sch, .brd)
  • Schematics (PDF)
  • Bill of materials (XLS)

They can be found in the mbed HDK repository:


Please log in to start a discussion or ask a question.

Discussion topics

TopicRepliesLast post
Xbee connection error on mbed application shield 1 06 Feb 2017 by Ines Masmoudi

Questions