Analog to digital
conversion with
the internal
AD converter.
Input comes from a potentiometer of 4K7 and the result
is sent to eight leds as in chapter 1.
The wiper of the potentiometer is connected with P1.7,
the other two wires go to VCC and ground.
Load the program. The differences between the three SHOW demos
lie only in the way they show the results.
All noForth input and output (KEY and EMIT) will be done through a Bluetooth HC06 module.
Remove the TX and RX jumpers from J3 on the Launchpad and
solder 4 wires on the HC06 at TX, RX, VCC(3.3V) and GND.
Then connect HC06 with the Launchpad:
HC06 power, pin12 & 13 to Launchpad J6, VCC & GND.
HC06 TX & RX, pin1 & 2 to Launchpad J1, pin3 & 4.
The Bluetooth module does not need any extra software. First couple the HC06, then
press the reset button. Now the RS232 communication goes thru Bluetooth.
The e04 program causes that all received characters
also will be displayed on the leds as in chapter 1 (this has nothing to do with Bluetooth!).
Therefore the led ports must be initialized
and the the KEY function must be extended.
These two things are done by STARTUP .
The STARTUP action is stored in APP and
the situation is made permanent by FREEZE .
The result is that STARTUP is executed automatically when noForth starts
(press the reset button).
How to prevent the initialization at reset:
press the reset button while the S2 button is held down.
How to remove the program: type TOOLS\ (see readme2 on the noForth website).
(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.
hardwareinstructies
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.
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. The user
word here is RELAIS-CONTROL . This kind of delay is used at elevator
doors for example.
Note that the driving transistor
and voltage powering the relais may need adaptation too.
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 .
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.
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.
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!!!