Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective of my assignment is to execute a program in CodeWarrior software. I was able to create a coding that represents the conditions of given

Objective of my assignment is to execute a program in CodeWarrior software. I was able to create a coding that represents the conditions of given goals and instruction, but I keep getting a minor error that is preventing me complete this exercise. I need help to solve this issue, and it is due today? Thank you

Goal: To become familiar with branch instructions, loops, using port H as an input port and port B as an output port, using dragon12-Light boards

When both DIP switches #8 and #1 are high, turn on all LEDs.

When both DIP switches #8 and #1 are low, turn off all LEDs

When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs.

When DIP switch #1 is high and #8 is low, turn on all the odd numbered LEDs.

Your program must to read DIP switches and turn on/off corresponding LEDs continuously until a Reset.

Note 1: The DIP switches on the boards are numbered 12345678 for bits 76543210.

Note 2: DIP switches are connected to port H, and LEDs are connected to port B.

image text in transcribed

image text in transcribed

Error: C2801:''missing main.c line 55 Error : c2801: '' missing b )-M. Path: C:\Users gailsmart52gmail.com Documents untLabonet Sources main.c Include derivative-specific definitions The microcontroller chip used by Dragon12-Light boards #include /*derivative information/ Gloable Variables Function Prototype void InitSwitches (void) void InitLEDs (void) void Delaylime(unsigned 1nt, unsigned int): Hain program section void main(void) * put your own code here* InitSwitches() InitLEDs() /do this forever for ) unsigned char x //get data from DIP Switches via. PTH PORTB=0, //Turn on a11 LEDs if((!O)&&(0))t PORTB- Oxff: //Turn off all LEDs if ((1)&&0) PORTB- Oxaa: /Turn on all even LEDs if ((1)&10)) PORTB+0x55, //Turn on all odd LEDs DelayTime(1. 4000) //optional, delay some time PORTB = x; //and send it to PORTB LEDs DelayTime(1. 4000) //optional Function InitSwitches

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions