//
// PICT10c.C // // An extension of Peter A's flash program (finally works!) // demonstrates bit manipulation // // Using '84 on a board (simple solderless breadboard with // 16F84 on it) and Peter Anderson's include file with // port/bit definitions (defs_f84.h available at www.phanderson.com) // Settings: // 4Mhz resonator (not important) // All Port A inputs use external pullups (resistor SIP used) // Port B outputs tied to a LED array (Radio Shack has 'em) // Port A inputs tied to ground through four switches // (pullups still are on them - makes it all work!) // This demo only uses ra0 as an input and rb1 as an output // Flip switch on A0 and it should light B1 // #case #include <16f84.h> #include// defines registers and bits #fuses xt,nowdt,put,noprotect void main(void) { trisb1=0; // make rb1 an output trisa0=1; // make ra0 an input while(1) // always { if(ra0==1) rb1 = 1; if(ra0==0) rb1 = 0; } }