Confirmed that Relay2 setup is correct.

This commit is contained in:
jakeg00dwin 2024-09-03 19:12:15 -07:00
parent 5409058a9a
commit 3a97338730
1 changed files with 13 additions and 2 deletions

View File

@ -50,6 +50,17 @@ void setup_relays(Relay *arr) {
PORTA.DIR |= (1 << RELAY0_ENPIN);
PORTA.DIR &= ~(1 << RELAY0_INPIN);
// setup the second relay
arr[1].output_port = &PORTB.OUT;
arr[1].output_pin = RELAY1_ENPIN;
arr[1].input_port = &PORTA.IN;
arr[1].input_pin = RELAY1_INPIN;
arr[1].disabled_fpc = false;
// Set the directions for the input and output pins/ports
PORTB.DIR |= (1 << RELAY1_ENPIN);
PORTA.DIR &= ~(1 << RELAY0_INPIN);
//for (int i = 0; i < N_RELAYS; i++) {
//Relay_MeasureMakeTime(&arr[0]);
@ -65,9 +76,9 @@ int main(int argc, char **argv) {
Relay relay_array[N_RELAYS];
setup_relays(relay_array);
Relay_MeasureMakeTime(&relay_array[0]);
Relay_MeasureMakeTime(&relay_array[1]);
_delay_ms(500);
Relay_MeasureBreakTime(&relay_array[0]);
Relay_MeasureBreakTime(&relay_array[1]);
// Setup for Infinite Loop