Demo Code for EEM202A/CSM213A Fall 2010

 

Demo1: Hello World on the LEDs

Lights up the 4 LEDs in turn.

202_01_HelloLEDWorld

 

Demo2: Hello World over Serial

Uses the serial port (emulated over USB) to send a string to a PC.

202_02_HelloSerialWorld

 

Demo3: Hello World over Bluetooth

Uses the serial port on pins P9 and P10 to send a string to a PC over Bluetooth. You need to connect a bluetooth - to - serial converter, like the BlueSmirf for this to work.

Connections:

BlueSmirf <---> MBED

PWR <---> VOUT

GND <---> GND

RX-I <---> P9

TX-O <---> P10

202_03_HelloBluetoothWorld

 

Demo4: Send Light Data over Bluetooth

In addition to the circuit in Demo3, connect a light sensor (like this one from Vex Robotics) to an AnalogIn pin, read it and send the data over bluetooth to a PC.

Connections:

Red wire goes to VOUT

Black wire goes to GND

White wire goes to P20

202_04_BluetoothLightSense

 

Demo5: Control a Servo Motor using Light Sensor

Connect a servo motor (like this one from Vex Robotics) to the circuit in Demo4 to control the position of the shaft. Note that because the VOUT pin cannot supply sufficient voltage or current, you need an external energy source for the motor. We used a Li-ion battery.

Connections:

Red wire goes to positive terminal of battery

Black wire goes to negative terminal of battery and to GND of MBED

White wire goes to P21 of MBED

202_05_LightServo


0 comments

You need to log in to post a comment