약간의 수정

This commit is contained in:
2025-12-09 02:34:41 +09:00
parent 0697b5ab31
commit d3a2802333
22 changed files with 406 additions and 25 deletions

17
ccs/ir.c Normal file → Executable file
View File

@@ -27,13 +27,22 @@ void ir_read_ready() {
void ir_read_value(uint8_t *value) {
int i;
uint8_t port_value = P7->IN;
for (i = 0; i < 8; i++) {
value[i] = !!(port_value & (0x01 << i));
}
*value = P7->IN;
}
void ir_read_off() {
P5->OUT &= ~0x08;
P9->OUT &= ~0x04;
}
void test_ir(void) {
uint8_t ir_value;
while (1) {
ir_ready_ready();
ir_read_value(&ir_value);
print_binary(ir_value);
printf("\n";)
ir_read_off();
}
}