28123 Parallax Inc, 28123 Datasheet - Page 226

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
Further Investigation
“Applied Sensors”, Student Guide, Version 2.0, Parallax Inc., 2003
“Industrial Control”, Student Guide, Version 2.0, Parallax Inc., 2002
The key to solving this problem is to insert an
whether the photoresistor reading is above some threshold value. If it is, flash
the LED. The threshold value can be found by running TestPhotoresistor.bs2
and observing the readings. Note the difference between an unshaded and a
shaded value. Take a value somewhere in the middle and use that for your
threshold. In the solution shown, the threshold value was encoded in a constant
named
' What's a Microcontroller - Ch07Prj01_PhotoresistorFlasher.bs2
' Make LED on P14 flash whenever a shadow is cast over
' the photoresistor.
' {$STAMP BS2}
' {$PBASIC 2.5}
Dark
time
DO
LOOP
More in-depth coverage of light measurement using a photodiode, scientific
units and math are featured in this text along with other sensor applications.
Stamp Plot Lite was developed in conjunction with this text to demonstrate the
fundamentals of techniques used in industrial process control.
HIGH 2
PAUSE 100
RCTIME 2, 1, time
DEBUG HOME, "time =
IF (time > Dark) THEN
ENDIF
HIGH 14
PAUSE 100
LOW 14
PAUSE 100
Dark
CON
VAR
to make the program easier to change.
25
Word
Change "Dark" constant for your conditions.
", DEC5 time ' Print value to Debug Terminal
' Read photoresistor with RCTIME
' Compare reading to known dark value
' Blink LED on pin P14
IF…THEN
statement that tests

Related parts for 28123