Demo Code for EEM202A/CSM213A Fall 2010
Demo1: Hello World on the LEDs
Lights up the 4 LEDs in turn.
Demo2: Hello World over Serial
Uses the serial port (emulated over USB) to send a string to a PC.
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
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
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
0 comments
You need to log in to post a comment