28123 Parallax Inc, 28123 Datasheet - Page 209

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
' Write light measurements to EEPROM.
' {$STAMP BS2}
' {$PBASIC 2.5}
time
eepromAddress
DEBUG "Starting measurements...", CR, CR,
PAUSE 1000
FOR eepromAddress = 0 TO 58 STEP 2
NEXT
DEBUG "All done.
END
How StoreLightMeasurementsInEeprom.bs2 Works
The
to count in steps of 2 because word values are written into the EEPROM.
The
The
eepromAddress
variable is incremented by two each time through the loop because a
up two bytes. The address for a
HIGH 2
PAUSE 5000
RCTIME 2, 1, time
DEBUG DEC2 eepromAddress,
WRITE eepromAddress, Word time
RCTIME
FOR…NEXT
time
"Measurement
"-----------
"ReadLightMeasurementsFromEeprom.bs2"
FOR eepromAddress = 0 to 58 STEP 2
NEXT
"
RCTIME 2, 1, time
WRITE eepromAddress, Word time
variable is stored at the address given by the current value of the
command loads the time measurement into the word size
loop that measures the RC-time values and stores them to EEPROM has
VAR
VAR
variable each time through the loop. Remember, the
Now, run:", CR,
Value", CR,
-----", CR
", DEC time, CR
Word
Byte
WRITE
command is always in terms of bytes.
Word
time
eepromAddress
variable.
variable takes

Related parts for 28123