Byte wide output to I/O-port 2 wired with eigth 3mm leds. The eight leds
must be placed on the breadboard with anode connected from P2.0 to
P2.7 see the documentation of the Launchpad. All the kathodes are
connected together and wired to ground using a 100 Ohm resistor.
The schematics and the finished project are found in the pictures
above this text.
The words COUNTER and RUNNER are the user words.
Byte output to I/O port wired with 8 leds and bit input using a switch.
This example adds bit input to project 1, the leds stay on the breadboard
and the switch S2 on the launchpad board is used as an input. This switch
is wired to P1.3. It's action is very straightforward, when pressed the
delay time is changed.
The user words are also COUNTER and RUNNER .
Analog to digital conversion using the internal AD converter, output to leds
The leds of project 1 & 2 stay on the board, now a potentiometer of 4K7 is
added.
The center wire has to be connected to P1.7 the other two wires to VCC
and ground see also the added schematics & photo.
The user words are SHOW-ADC1 and SHOW-ADC2 both using a different way of
displaying the measured value.
Connecting a wireless Bluetooth module and show received data also on the leds.
The leds stay on the board, now a HC06 Bluetooth module is added. One have to
solder 4 wires to the HC06 for TX/RX and VCC (3,3V) and ground.
Two jumpers need to be removed, the TX and RX jumpers at J3. Connect the
power for the HC06 {pin12+13} with Launchpad J6 {VCC+GND}. TX & RX from HC06
{pin1+2} with Launchpad J1 {pin3+4}. For more info see the schematics and
the photo's. After typing STARTUP or pressing the reset key all communication
goes thru Bluetooth. Take care that you couple the HC06 first! All received
characters are displayed on the leds too.
(using the first 3 chapters)
Wireless analog datalogger combining the first three chapters to
build a first application. An LDR is used as an analog sensor. This sensor
is sampled 10 times every second, but only every tenth value is stored.
After 20 samples are gathered they are sent back to the receiving device.
The user word is DATALOGGER this program will startup after every reset.
If you do not want this program to start, you also have to press S2 before
pressing reset or connecting the power. More info see schematic and photo's.
Using timer TA1 as pulsewidth modulator with the output on P2.4.
Also an example of bit-I/O using two switches to adjust the dutycycle.
The up key is connected to P1.4, the down key to P1.5, see photo and schematics.
This example controls the brightness of a medium power led. The PWM freqency
is high about 8KHz the resolution too it is 2000 steps. Using the internal
MSP430 hardware this is easy. A full software solution would use all
available CPU time. The user words are CYCLUS and POWERCONTROL .
Bit input from P1.3 (S2) and bit output to P2.2 to control a relais,
also software examples of delayed on and off switching.
An relais may be used a switch large currents and high voltages
depending on the specs of the relais. Note that the driving transistor
and voltage powering the relais may need adaptation too. The user
word here is RELAIS-CONTROL . This kind of delay is used at elevator
doors for example.
Bit output using timer TA0 to control the pulsewidth of 2 model servo's.
This example uses a timer interrupt, so it is also an example of
the use of (timer)interrupts. P1.4 and P1.5 are wired to the signal
line of each servo more info see the schematics and photo.
User words: SERVO-ON SERVO-OFF SERVO and the demo MOVE-SERVOS .
Also needed for this robot: some wood or alu-sheet, 16 cm
alu staff material bend as two squares. Finally some double sided
sticky tape and some screws and nuts.
Small walking robot with two legs using four servo's, two for each leg.
A wireless controlled robot using code from the info from the first
eight chapters to build a walking robot.
The servo's are connected to P1.4 to P1.7, the TX/RX of the HC06 are
wired to P1.1 and P1.2 see also chapter E04!!
The user words are: BIPED-ON and BIPED-OFF , WOBBLE , WALK and HELLO .
The words: REST , RIGHT-UP , LEFT-UP , RIGHT-FORW , LEFT-FORW , DOWN ,
WAVE , TOES and REST may be used to build more complex functions.
The code is kept very simple, so there is plenty room for improvement!!!