1818281+1818282 Microchip Technology, 1818281+1818282 Datasheet - Page 21

no-image

1818281+1818282

Manufacturer Part Number
1818281+1818282
Description
EDF / AMICUS18 + SHIELD, BUNDLE
Manufacturer
Microchip Technology
Type
Development Boardr

Specifications of 1818281+1818282

Kit Contents
Board
Svhc
No SVHC (15-Dec-2010)
Kit Features
Nine 10-bit ADC Inputs, Two 10-bit PWM Outputs, Two Comparators
Mcu Supported Families
PIC18F25K20
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC18
Silicon Core Number
PIC18F
Silicon Family Name
PIC18FxxKxx
The circuit for the traffic light sequencer is shown below:
The sequence of traffic lights in the UK is shown below:
The program below shows the steps required to reproduce the sequence of lights shown above:
' Simulate a single traffic light using Red, Yellow, and Green LEDs
'
' Time that the Red and Amber lights will stay on
' Time that the Amber light will stay on
Type in the program above, remembering that you do not need to type in the comments. Click on the
toolbar
microcontroller. The three LEDs will then start sequencing.
Crownhill AssociatesLimited 2009 - All Rights Reserved
Symbol Red = RB0
Symbol Amber = RB1
Symbol Green = RB2
Symbol RedInterval = 4000
Symbol AmberRedInterval = RedInterval / 4
Symbol AmberInterval = RedInterval - AmberRedInterval
Symbol GreenInterval = 6000
While 1 = 1
Wend
High Red
DelayMS RedInterval
High Amber
DelayMS AmberRedInterval
Low Red
DelayMS AmberInterval
High Green
Low Amber
DelayMS GreenInterval
Low Green
High Amber
DelayMS AmberInterval
Low Amber
Compiler and Program
Amicus18 Companion Shield
Version 1.0
button or press F10 to compile the code and load it into the Amicus18’s
PortB
Power
' Red LED is attached to RB0
' Amber LED is attached to RB1
' Green LED is attached To RB2
' Time that the Red light will stay on
' Time that the Green light will stay on
' Create an infinite loop
' Illuminate the Red LED
' Wait for the appropriate length of time
' Illuminate the Amber LED
' Wait for the appropriate length of time
' Extinguish the Red LED
' Wait for the appropriate length of time
' Illuminate the Green LED
' Extinguish the Amber LED
' Wait for the appropriate length of time
' Extinguish the Green LED
' Illuminate the Amber LED
' Wait for the appropriate length of time
' Extinguish the Amber LED
' Do it forever
GND
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
Cathode
Anode
47
LED
Ω
20
47
LED
Ω
47
LED
Ω
06-10-2009

Related parts for 1818281+1818282