The following C program reads a byte of data from Port B, finds the square, wait for two (10 Marks) second and then send
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The following C program reads a byte of data from Port B, finds the square, wait for two (10 Marks) second and then send
The following C program reads a byte of data from Port B, finds the square, wait for two (10 Marks) second and then send it to Port D. Debug the errors in the following C program for the PIC16 microcontroller and write the corrected program. (2marks per error identified and correction) #include <xc.h> void MAIN (void) { unsigned char; TRISD = 0x00; TRISB = 0x00; while (1) { readbyte = PORTB; readbyte *= readbyte ____delay_ms(2000); readbyte = PORTD; } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!