28123 Parallax Inc, 28123 Datasheet - Page 262

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
' -----[ Subroutine - Find Index of Note ]--------------------------------
' -----[ Subroutine - Determine Note Duration ]---------------------------
ProcessNote:
ProcessDuration:
RETURN
READ RTTTL_File + counter, char
SELECT char
ENDSELECT
RETURN
READ RTTTL_File + counter, char
SELECT char
ENDSELECT
IF default_d <> 0 THEN
ELSE
CASE "p"
CASE "a" TO "g"
CASE "1", "2", "3", "4", "8"
duration = 60000/default_b/duration*3
default_d = duration
index = 0
counter = counter + 1
FOR index = 1 TO 12
NEXT
counter = counter + 1
READ RTTTL_File + counter, char
SELECT char
ENDSELECT
duration = char - 48
counter = counter + 1
READ RTTTL_File + counter, char
SELECT char
ENDSELECT
CASE ELSE
duration = default_d
READ Notes + index, noteLetter
IF noteLetter = char THEN EXIT
CASE "#"
CASE "6", "2"
index = index + 1
counter = counter + 1
duration = duration * 10 + char - 48
counter = counter + 1
' If 0, then set default_o.
' Set index value for lookup
' of note frequency based on
' note character. If 'p',
' index is 0.
' read character values in
' DATA table and find match.
' Record index value when
' match is found.
' char is a sharp (#), add
' 1 to the index value to
' increase the index (and
' frequency) by 1 notch.
' As with other subroutines,
' increment counter for each
' character that is processed.
' Check to see if characters
' form 1, 2, 4, 8, 16 or 32.
' If yes, then convert from
' ASCII character to a value
' by subtracting 48. In the
' case of 16 or 32, multiply
' by 10 and add the next
' digit to the ones column.
' If no duration, use
' use default.
' If default_d not defined
' (if default_d = 0), then
' set default_d = to the
' duration from the d=#.
If 'a' to 'g',
If next

Related parts for 28123