28123 Parallax Inc, 28123 Datasheet - Page 283

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
LOW UdPin
FOR counter = 0 TO 127
NEXT
' -----[ Main Routine ]----------------------------------------------------
DO
LOOP
' -----[ Subroutines ]-----------------------------------------------------
Get_New_Tap_Setting:
Set_Ud_Pin:
Pulse_Clk_pin:
PULSOUT 6,5
PAUSE 1
GOSUB Get_New_Tap_Setting
GOSUB Set_Ud_Pin
GOSUB Pulse_Clk_pin
DEBUG CLS, "Tap setting is: ",
DEBUG "Enter new tap", CR, "setting (0 TO 127): "
DEBUGIN DEC newTapSetting
RETURN
IF newTapSetting > oldTapSetting THEN
ELSEIF newTapSetting < oldTapSetting THEN
ELSE
ENDIF
RETURN
' Deliver pulses from old to new values.
' adjusted the value of oldTapSetting toward newTapSetting by one.
' This keeps the FOR...NEXT loop from executing one too many times.
HIGH UdPin
oldTapSetting = oldTapSetting + 1
LOW UdPin
oldTapSetting = oldTapSetting - 1
DEBUG CR, "New and old settings", CR,
PAUSE DelayReader
DEC newTapSetting, CR, CR
"are the same, try ", CR,
"again...", CR
Keep in mind that Set_Ud_Pin
' Set U/D pin for Down.
' Set tap to lowest position.
' User display and get input.
' Set U/D pin for up/down.
' Deliver pulses.
' Display instructions and
' get user input for new
' tap setting value.
' Examine new and old tap values
' to decide value of U/D pin.
' Notify user if values are
' equal.
' Increment for Pulse_Clk_pin.
' Decrement for Pulse_Clk_pin.
' Give reader time to view
' Message.

Related parts for 28123