Well, for starters there are problems with the Ardunio CAN bus library, as ANY node in the system can be a master or a slave. Currently, the Arduino CAN supports a SLAVE - MASTER, relationship. On the MCP2515_CAN module, you have the following connection on the header, plus outputs Hight and Low. So with what little time I have remaining. I just will be sending and receiving messages via the USB port using CANaerospace formatted messages.
|MOSI||SI||51||4||Master Out / Slave In|
|MSO||SO||50||1||Master Slave Out|
The Fuel Load Indicator has two switches:
1. UP / DOWN switches control which fuel tank is being filled or the current value of the selected tank. This is a circular list.
2. Fill controls the filling of the selected tank (see switch 1)
3. TEST position tests the system when selected both displays will turn on both displays.
After TESTING the upper display will display total fuel load in pounds, the lower display will display tank number and US Gallons.
There can be up to eight (8) tanks with CAN identifiers 668 - 675 with fuel total identifier at 1301. The Fule Load Indicator must also respond to IDS (node 0) Identification service. Requests a "sign-of-life" response together with the configuration from the addressed node.
Now back to the switches. I plan on using an SN74LS148 an 8 input to 3 BCD priority encoder. A nice feature of the encoder it has an extra output EO since all of the switches are pulled up EO = LOW, when a switch is energized EO = HIGH. The EO output is input to an SN74LS14 hex Schmitt-Trigger. The output of the Schmitt-Trigger is pin number 3 on the Arduino's Interrupt Pin.
- Please Note that pinInterrups value equals 3 and the name of the interrupt is ISR3. This keeps things straight in my mind.
- I could use bit manipulation:
valA = digitalRead (pinA );
valB = digitalRead (pinB );
valB << 2;
valC = digitalRead (pinC );
valC << 3;
testValue = valA + valB + ValC;
switches ( testValue );