You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
499 B
C
23 lines
499 B
C
#include <avr/io.h>
|
|
#include "io-helper.h"
|
|
|
|
int main(void) {
|
|
ioHelperIoConf();
|
|
while(1) {
|
|
ioHelperSetOuts(); //write data from outStates to ports
|
|
ioHelperReadPins(); //read pins, arrange data into inStates
|
|
|
|
//read a specific bit from inStates
|
|
if(ioHelperReadBit(inStates,BitPinC5)) {
|
|
//input on PortC, Bit 5 is high
|
|
;
|
|
}
|
|
|
|
//write a bit to outstates
|
|
ioHelperSetBit(outStates,BitPB1,1); //write 1
|
|
ioHelperSetOuts();
|
|
ioHelperSetBit(outStates,BitPB1,0); //write 0
|
|
|
|
}
|
|
}
|