int main (int argc, char ** argv) { int execResult = 0; picoInit(); // push to cut execResult = setAllPins(pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_ON,pin_OFF,pin_ON,pin_ON, pin_ON,pin_ON); if (execResult != 0) { fprintf(stderr, "Setting all pins in cut.c failed\n"); resetPins(); exit(2); } delay(1000); //TODO: check with team execResult = initALBA(); if (execResult != 0) { fprintf(stderr, "initALBA() in cut.c failed = %d \n", execResult); exit(3); } return 0; }
int main (void) { // HW Check if (system("grep 00000000440fb444 /proc/cpuinfo > /dev/null")) { //printf("HW ERROR #1\n"); return 1; } setAllPins(pin_ON,pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_OFF,pin_OFF); return 0; }
bool Registers::initialize(unsigned int theSerialPin, unsigned int theSerialClockPin, unsigned int theRegisterClockPin, unsigned int theRegisterCount) { if (theRegisterCount>25) return false; serialPin = theSerialPin; serialClockPin = theSerialClockPin; registerClockPin = theRegisterClockPin; pinMode(serialPin, OUTPUT); pinMode(serialClockPin, OUTPUT); pinMode(registerClockPin, OUTPUT); registerCount = theRegisterCount; setAllPins(LOW); return true; }