Professional Documents
Culture Documents
Right
Right
APR 2023
-1-1 ) {
< 101 ; n
for (n=l ; n
OBI 0000000 ;
Y =
PORT D= Y ;
< 8; ✗ + + ) {
0 ; ✗
for ( ✗
=
X;
PORT D= ✗
( 300)
- delay .ms
-
3 0001 ;
OB 0000
Y
=
< 8; ✗+ t ){
for ( ✗ = 0; ✗
x ;
D= Ya
PORT
delay -
_
ms ( 300)
-
}
use Data in Port B to obtain new in
port ☐
0,1 ¢ ,
Void main / void) {
TRIS D= 0 ;
TRI D= 0 ;
int i ;
for ( iso : i 25 ; i ++ ) [
PORT A- ✗ [ i] ;
- -
if ( i % 2 = =D {
y [i ]
= ✗ [ i ] +1 ;
3
else (
y [i ] = ✗ [ i] ;
3
PORT D= Y[ i ] ;
- -
delay _
ms ( 500) ;
3
While (1) ; 11 Stay here
Final Exam Jan -
APR 2022
Q2 (A)
Void main ( void) [
TRIS D= 0 ;
int him ;
× ,
y ,
2251 ; ) {
for ( n
n -1-1
= 1 ; n
PORT D= 0 ;
3
I/ Stay here
while (1) ;
Test 1 May -
Any 2022
Q1 (b)
int him ,
×
,y ,
in -1-1 ) {
for (n=1;ne6
for (m=1;m< 6 ; m -1-1 ) {
for ( ✗ =\ ;m< 5 ; ✗ + + )L
D= 255 ;
PORT
-
-
delay .ms ( 500 ) ;
PORT D= 0 ;
3
I/ Stay here
while (1) ;
I ii:
Q ] :c
" 7
Void main / void) { g-
6
TRISB -_ 0 ;
TRID :O ;
w
inti ;
for ( i=o:ic5;i++)[
PORTA -
✗ [ i] ;
- -
[i ]
941=11 -
✗
P0RTD=Y[ i ] ;
- -
delay _
ms( 500) ;
3
While (1) ; 11 Stay here