Almost working version

master^2
Jared 8 years ago
parent 50d8bbafa3
commit d0f3647d26

@ -23,7 +23,7 @@
#include <wiringPiI2C.h>
uint8_t solve_challenge(uint8_t arg) {
return (arg >> 3) ^ (arg << 3);
return (arg >> 3);
}
uint8_t parse_int(const char *s) { // Convert string to hex
@ -67,8 +67,11 @@ int main(int argc, char *argv[]) {
delay(1);
challenge = wiringPiI2CRead(fd);
printf("Received %d\n", challenge);
response = solve_challenge(challenge);
wiringPiI2CWrite(fd, response);
printf("Sending %d\n", response);
delay(100);
wiringPiI2CWrite(fd, (uint8_t)response);
return 0;
}

Loading…
Cancel
Save