Question
Write instructions to initialize PORTB as follows: RB0-RB3 as outputs and RB4-RB7 as inputs (Figure 9-19b). Enable pull-up resistors. Read the input switches and turn on the corresponding LEDs for the switches that are on (grounded).

***Using PIC18F language code**** please****

RB6 RB5 RB4 RB3 RB2 RB1 RB0 S2 S1 SO LD3 LD2 LD1 LDO FIGURE 9-19 (b)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

int main while (1)

Add a comment
Know the answer?
Add Answer to:
Write instructions to initialize PORTB as follows: RB0-RB3 as outputs and RB4-RB7 as inputs (Figu...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C CODE LANGUAGE. MSP430. #include <msp430fr6989.h> #define redLED BIT0 // Red LED at P1.0 #define greenLED...

    C CODE LANGUAGE. MSP430. #include <msp430fr6989.h> #define redLED BIT0 // Red LED at P1.0 #define greenLED BIT7 // Green LED at P9.7 #define BUT1 BIT1 // Button S1 at P1.1 #define BUT2 BIT2 // Button S2 at P1.2 void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop the Watchdog timer PM5CTL0 &= ~LOCKLPM5; // Enable the GPIO pins // Configure and initialize LEDs P1DIR |= redLED; // Direct pin as output P9DIR |= greenLED; // Direct pin as output...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT