DM163045 Microchip Technology, DM163045 Datasheet - Page 50

no-image

DM163045

Manufacturer Part Number
DM163045
Description
PICDEM Lab Development Kit (with PICkit 3) General Purpose
Manufacturer
Microchip Technology
Series
PICDEM™r
Type
MCUr
Datasheet

Specifications of DM163045

Contents
Board, PIC kit 3
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
PIC Micro® MCU

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM163045
Manufacturer:
MICROCHIP
Quantity:
12 000
PICDEM
DS41369A-page 46
TM
3. Copy/paste the code in Example 3-19 into the Get_Inputs() at the section
EXAMPLE 3-19:
4. Copy/paste the code in Example 3-20 into the Decide() over the code from the
EXAMPLE 3-20:
Lab Development Board User’s Guide
0b00000000)) LED_Output = 0b10000000;
0b00000000)) LED_Output = 0b00000001;
labeled:
//ADD GET_INPUTS CODE HERE
previous lab.
//Check for a push button press (i.e. RA2 = 0)
if (RA2 == 0)
{
}
//Otherwise keep direction the same as it was
else direction = direction;
if(direction == 0)
{
//First check if LED_Output variable has most
//significant bit set to 1 or if LED_Output variable is
//all 0's.
//If so, re initialize the LED_Output variable so that
//the most significant bit is set to 1 and all other
//bits are 0
//If neither of these conditions are true, simply shift
//the LED_Output variable's contents to the Left by 1
//bit position
}
else
{
//First check if LED_Output variable has the least
//significant bit set
//to 1 or if LED_Output variable is all 0's.
//If so, re initialize the LED_Output variable so that
//the least significant bit is set to 1 and all other
//bits are 0
//If neither of these conditions are true, simply shift
//the LED_Output variable's contents to the Right by 1
//bit position
}
Delay_5mS(); //Delay to debounce
//Check if push button is still pressed
if(RA2 == 0) direction ^= 1; //If so, toggle the
if((LED_Output == 0b00000001) || (LED_Output ==
else LED_Output >>=1;
if((LED_Output == 0b10000000) || (LED_Output ==
else LED_Output <<=1;
GET_INPUTS() CODE FOR GPIO LAB 5
DECIDE() CODE FOR GPIO LAB 5
//direction bit
© 2009 Microchip Technology Inc.

Related parts for DM163045