05.08.2013 Views

Ming Hsieh Department of Electrical Engineering Programming the ...

Ming Hsieh Department of Electrical Engineering Programming the ...

Ming Hsieh Department of Electrical Engineering Programming the ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

unsigned char up;<br />

T1SC_TOF = 0; // must read T1SC and <strong>the</strong>n write a zero in bit 7<br />

up = PTA_PTA1 ;<br />

if (up) { // if button is not pressed , up = 1<br />

if (++ cnt > 15) // and we count up in hex<br />

cnt = 0;<br />

}<br />

else { // if button is pressed , up = 0<br />

if (-- cnt < 0 || cnt > 9) // and we count down in decimal<br />

cnt = 9;<br />

}<br />

display_digit ( cnt );<br />

EE 459Lx, Rev. 5/29/13 20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!