Project 1 in "What's a Microcontroller"?
fjohnson
Posts: 2
I'm a newbie to this MC stuff. I am following the Parallax book, What's a Microcontroller? In chapter 2, at the end (pg. 68), there is a project I cannot make work. I have looked over the code several times with no success. So far all has gone as the book says it should except this. Any help please.
Frank
Frank
Comments
Below·is my source code
Everything in Chapter 2 prior to Exercises, worked OK.· I think it matches the code on pg. 69 & 70 in the book.
When you 'Run', the Red Bi-LED comes on and at the same time the Yellow comes on and flashes for 10 seconds. The Red stays on solid for the same 10 seconds the yellow is on. It should be on for 3 seconds, then the Yellow is to come on and flash. After the Yellow stops flashing the Green comes on and stays on, the Red does not follow as it should.
The schematic is as follows: Matches Yellow LED on pg. 48. The Bicolor matches pg. 64.
'WAM - Chp2 Project.bs2
'Page 68
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running"
counter VAR Byte
'Red for three seconds········ 'Bi color LED Red
HIGH 15
LOW 14
PAUSE 3000
'Green for 10 seconds
LOW 15························ 'Bi color LED Green
HIGH 14
'.....WHILE the Yellow LED is flashing
FOR counter = 1 TO 10
HIGH 13······················ 'Yellow LED on
PAUSE 500
LOW 13······················· 'Yellow LED off
PAUSE 500
NEXT
'Red stays on················· 'Bi color LED Red
HIGH 15
LOW 14
If you want to know all the things about a microcontroller than you are going to want a book. There are a lot of different microcontrollers from different manufactures.
I have few information on 8051 microcontroller.
microcontroller consist of only these part;
1. CPU
2. Ram
3. Rom
4. I/O
5. Alu
6. Timer