Recent Posts

Okay, I will give it a try. I am new to the code stuff, so how would you write that part(Or which pins use OUTPUT and etc?)? The input on the controller says from 5-24v so I can check it. I could possibly get a 5v power supply instead of a 12v to bypass that if it is on 12v. Thanks

As you can see from schematics fpga.is connected to almost all pins of Nina so if you want you can route Nina pins to mkr connector or to mini PCIe. At the moment current images can only use Nina pins as iOS to/from fpga.

The "general" approaches to connecting two wires are not appropriate here (you'd need a relay or something - bulky, current hungry, and awkwardly large.

There are much simpler ways, but you need to figure out how those controls are wired.

Get out your DMM, test continuity - I'll wager than one of those pins is tied to ground, and the other is pulled up by the controller. Check which is which, and to what voltage the one not grounded is tied to - if it's 5v or less, that can go direct to an arduino pin. Set the pin to OUTPUT to drive it low and simulate a button press. If it's to the full 12v, connect it to the drain of a small logic level MOSFET, ground to the source of said MOSFET, and gate through a small resistor (100 ohms is good, but you can go up to a couple k in a low-current situation like this, and in practice with small fets, you don't even need it - though it's always good practice)

In all cases, ground of controller should be tied to ground of the arduino. If this is a problem, use an opto (but you still need to know the polarity) to isolate it from the arduino ground.

void HAZ_S_BLINK(){ //HAZARD lights will be toggled only if more time has passed than the FLASH_INTERVAL_SHORT //AND we have not exceeded the maximum allowed for the hazard function. if (((LOOPTIME) - (HAZARD_TIME) >= (FLASH_INTERVAL_SHORT)) && (HAZARD_COUNT <= MAX_HAZARD_COUNT)) { SWITCH_HAZARD_S(); if (TwoWire==false) { digitalWrite(Lrun,LOW); digitalWrite(Rrun,LOW); } } if (HAZARD_COUNT > MAX_HAZARD_COUNT) { LIGHTS_NORMAL(); }}

void SWITCH_HAZARD_S(){ //Routine toggles the signal lights on or off, increments the count of half-cycles, and records the time this is done HAZARD_TIME=millis(); HAZARD_LIGHTS_STATE= !HAZARD_LIGHTS_STATE; HAZARD_COUNT=HAZARD_COUNT + 1; digitalWrite(Lout,HAZARD_LIGHTS_STATE); digitalWrite(Rout,HAZARD_LIGHTS_STATE);

void HAZ_L_BLINK() //HAZARD lights will be toggled only if more time has passed than the FLASH_INTERVAL_LONG //It will flash the lights indefinitely and risks running down the battery.{ if (((LOOPTIME) - (HAZARD_TIME)) >= (FLASH_INTERVAL_LONG)) { SWITCH_HAZARD_L(); if(TwoWire==false) { digitalWrite(Lrun,LOW); digitalWrite(Rrun,LOW); } }}