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

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
Notice how the state of the pin is 1 when the button is pressed. This is because the weak pull-up resis-
tor (22K
Volts when it’s operated. This is the exact opposite of using a pull-up resistor.
Now that we know that the pin’s state is 1 (high) when the button is operated, decisions can be made
upon it.
The program below will flash the LED 10 times when the button is pressed:
' Demonstrate a switch input using a pull-down resistor
' Flash an LED based upon a button press
'
'------------------------------------
' Subroutine to flash the LED
FlashLED:
'------------------------------------
' Main program starts here
Main:
Crownhill AssociatesLimited 2009 - All Rights Reserved
Dim Flash As Byte
Symbol Switch = RB4
Symbol LED = RB0
GoTo Main
For Flash = 0 To 9
Next
Return
Input Switch
While 1 = 1
Wend
Ω
) holds the pin to ground when it’s not being operated, and the button pulls the pin to 3.3
High LED
DelayMS 100
Low LED
DelayMS 100
If Switch = 1 Then
EndIf
GoSub FlashLED
Amicus18 Companion Shield
Version 1.0
' Holds the amount of flashes
' Button is connected to RB4 (PortB.4)
' LED attached to RB0
' Jump over the subroutine
' Create a loop of 10 iterations
' Illuminate the LED
' Wait 100 milliseconds
' Extinguish the LED
' Wait 100 milliseconds
' Close the loop
' Exit the subroutine
' Make the button pin an input
' Create an infinite loop
' Is the button pressed ?
' Yes. So flash the LED
' Do it forever
26
06-10-2009

Related parts for 1818281+1818282