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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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 ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started