lights don't work

I recently downloaded this sketch from open cockpits Fess,s AP Panel build and I got it to work just fine for me all except that the only light that will work is the AP light. All others will no work. could someone take a look and explain what I need to do/change to have "ALL" lights work with the buttons/switches? (I need to say that I don't know to much about writing code for Arduino.) Thank You

hpwells

1Test_MCP_Mega_Wire.zip (7.51 KB)

One obvious question is how are the lights wired ?

Most here will not download a ZIP file.

Always show us your current compete sketch. Use CTRL T to format the sketch. Please use code tags. Use the </> icon in the posting menu. [code] Paste sketch here. [/code]

Show us a good schematic of your circuit. Show us a good image of your wiring.

.

Unable to post complete sketch and no attachments >:( >:(

hpwells1:
Unable to post complete sketch and no attachments >:( >:(

Use '>Attachments and other options' to add images and large INO files to your posts.

.

Thank You however the only time I had "attachments" offered was on my first post.

hpwells1:
Thank You however the only time I had "attachments" offered was on my first post.

Use the REPLY link and not the Quick Reply text box

Thank You Bob. here they are

hpwells

Test_MCP_Mega_Wire.ino (34.5 KB)

the only light that will work is the AP light.

I don't see how or why this is working, let alone the other lights.

The APP light appears to be on pin A6

A6	(60)	APP Light

and is set as an output

  pinMode(A6, OUTPUT);	// Analog pin A6  is also pin 60

There is no other mention of pin A6 in the code. It is not written to by the Arduino so I don't understand how or why it turns on.

What is the Wire interface writing to ?

There is no other mention of pin A6 in the code.

But, the pin number is hardcoded later:

			if (Digit == "2")
			{
				digitalWrite(60, HIGH);  //APP Light ON
			}
			else
			{
				digitalWrite(60, LOW);  //APP Light OFF
			}

But, the pin number is hardcoded later:

Aha, the old "refer to the pins by another designation but under no circumstances give them a meaningful name" trick !

This is the problem. The light for CMD AP on pin 57 (A3) is working as it should. The rest of the lights will not work, A5/Alt Hold Light, A6/App Light,A7/Vor Loc Light,A9/HDG Sel Light,and A12/Spd Light. If you read the intro to this sketch you will see that it was written for 2(TWO) Arduino boards using a LUA script and I "think" this is the problem but I don't know how to fix it.

hpwells

does anybody have an idea as to what I need to do to make the lights work?????