You are on page 1of 1

#include <ez8.

h>
void main (void) {
unsigned char Row;
unsigned int x;
// initialize ports
PEAF = 0x00; //PE Alt func = Port
PEOC = 0x00; //PE Out Ctrl = push-pull
PEDD = 0x00; //PE Data Dir = output
PGAF = 0x00; //PG Alt func = Port
PGOC = 0x00; //PG Out Ctrl = push-pull
PGDD = 0x00; //PE Data Dir = output
PDAF &= ~0x08; //PD3 is GPIO
PDDD |= 0x08; //PD3 is input
Row = 1;
while(1) {
PEOUT = 0x00;
PGOUT = Row;
PEOUT &= ~0x20; PEOUT |=0x20;
if (Row !=0x40)

You might also like