What is a microcontoller?
A microcontroller is like small computer that was made on a cheap
It is a low-cost circuit that contains many functions such as memory, processing units, and in/out put in a single unit
For the circuit we are going to make today
we need
1. PicAXE 08m(PIC 12F683)
2. BreadBoard
3. Wires
4. Femal Din9(serial) connector with wire soldered on
5. 2 LEDs
6. 2 resistors b/w 200-500 ohms
7. 5V power supply
8. 10K Ohm & 22K Ohm resistor
Here is the schematic
After building it
you should get
The purpose of the Din9 connector is so we can format the data inside fo the microcrontroller by using a computer
here is the baic lines we should type
mian:
high 1
pause 1000
low 1
pause 1000
goto main
the 1 means output 1
pause 1000 means pause for 1 second since it's measure in milisecond
high and low means turn on and off
goto main just make the program to run again
We can also upgrade this circuit into multi-LED
Here are the details of pins of the M series microcontroller
There are also other commands we can use to make the program better
such as the syombols, Comments & White-Space
you can type
symbol LED =1
this mean we change the name of the output1 into LED
when we type in the program we type LED instead of 1
this makes the program look for readable
the Comments ;
allows us to type describtion on the side and the program will not run it
high LED ;LED on
Using Digital Inputs
Common digital sensor are
1. microswitches
2. push and rocker switches
3. reed switches
adding this part to the circuit
Result
we can control the light to start to light up for 1 second and shut untill we press the bottom again
Next step, we will change the switches into a LDR (light Dependent Resistor)
follow the schematic shown below
we will get












No comments:
Post a Comment