Question: Objectives 1. Learn how to run multiple code in c language. 2. Learn implement delays with timer Methodology Start a new project as you did

Objectives

1. Learn how to run multiple code in c language.

2. Learn implement delays with timer

Methodology

Start a new project as you did it previously. In this experiment you will write a main code for given source files. Aim is that run leds and display seven segment together when button is pressed. Write the given codes as ?source file?. Head of the ?main? code is also given. You should write inside the main; call runing led function and seven segment function in the mean time which you have saved as source file previously, it is so short code, please do not think complicated, You just call the functions inside main that you have write as source. Search for calling function into main in MPLAB x c language on the internet. Not forget to assign ?header code?.

Understand that Led use delay function and seven segment use timer for assign a delay to button as it is given.

-Now write a main code for combine them. Head of the main code

Code of Running LED adefine _XTAL_FREQ 8999999UL #include #define BTN PORTBbits.RBO #define
led1 PORTBbits. RB1 #define led2 PORTBbits.RB2 #define led3 PORTBbits. RB3 char led
state = 1; void run_led() { } TRISBbits. TRISB1 = 0; TRISBbits.TRISB2

Code of Running LED adefine _XTAL_FREQ 8999999UL #include #define BTN PORTBbits.RBO #define led1 PORTBbits. RB1 #define led2 PORTBbits.RB2 #define led3 PORTBbits. RB3 char led state = 1; void run_led() { } TRISBbits. TRISB1 = 0; TRISBbits.TRISB2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It appears you are tasked with combining the provided pieces of code into a single main function in C language which is to be used within MPLAB X for ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!