28123 Parallax Inc, 28123 Datasheet - Page 287

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
“Industrial Control”, Student Guide, Version 2.0, Parallax Inc., 2002
counter
oldTapSetting
newTapSetting
lightReading
oldTapSetting = 0
newTapSetting = 0
LOW UdPin
FOR counter = 0 TO 128
NEXT
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
' -----[ Subroutines ]-------------------------------------------------
Set_Ud_Pin:
Pulse_Clk_pin:
Read_Photoresistor:
Industrial Control uses the transistor as an on/off switch for a resistor heating
element. It also uses a phototransistor to detect the passage of stripes on a
spinning wheel.
PULSOUT 6,5
PAUSE 1
GOSUB Read_Photoresistor
newTapSetting = lightReading
GOSUB Set_Ud_Pin
GOSUB Pulse_Clk_pin
IF newTapSetting > oldTapSetting THEN
ELSEIF newTapSetting < oldTapSetting THEN
ENDIF
RETURN
FOR counter = oldTapSetting TO newTapSetting ' from old to new
NEXT
oldTapSetting = newTapSetting
RETURN
HIGH PhotoPin
PAUSE 100
RCTIME PhotoPin, 1, lightReading
RETURN
LOW UdPin
PULSOUT ClkPin, 1
PAUSE DelayPulses
VAR
VAR
VAR
VAR
Byte
Byte
Byte
Word
' Counter for FOR...NEXT.
' Previous tap setting.
' New tap setting.
' reading from photoresistor
' Initialize new and old
' tap settings to zero.
' Set U/D pin for Down.
' Set tap to lowest position.
' Set U/D pin for up/down.
' Deliver pulses.
' Keep track of new and old
' tapSetting values.
' Examine old and new
' tap values to decide
' value of UdPin. Notify
' user if values are
' equal.
' Deliver pulses
' values.

Related parts for 28123