RB211 / apControl

Arduino based auto pilot controls with rotary encoders
4 stars 1 forks source link

Seven Segment not showing anything #1

Open Mavni opened 11 years ago

Mavni commented 11 years ago

Hi Bill!

I hooked my Arduino Mega to two TM1640s and flashed it with your apControl.ino, I connected the TM1640s Like this: Module1: Data pin 3, Clk pin 2 Module2: Data pin 5, Clk pin 4 I tried connecting them both on Analog and Digital pins

I can see that Link2fs is getting data from FSX, and is connected to my Arduino on COM7 (which is right)

Everyhting seems to be connected right, But i'm getting NOTHING on the TM1640s I do have a red LED on the side of the 1640s indicating that they are getting power, And I have tried using another code that operates the 1640s perfectly

I'm not very strong on the coding side, But as far as I understand, This should work

Could you please help me with this?

Thanks a lot in advance

Michael

Mavni commented 11 years ago

OK, It's working, My mistake...

But it's displaying only some of the data, even after checking the checkboxes How can I change the displays to show the data I want it to show?

Thanks again Michael

RB211 commented 11 years ago

Hi Michael, did you download and install the additional libraries that are mentioned at the top of the individual file? If so, run one of the examples for the 1640 display. Get that to work first before you dive into my program. I really need to make a readme and a wiki for this. I am moving out of my apartment today. Can't offer much time at the moment. On Nov 30, 2012 4:29 AM, "Mavni" notifications@github.com wrote:

OK, It's working, My mistake...

But it's displaying only some of the data, even after checking the checkboxes How can I change the displays to show the data I want it to show?

Thanks again Michael

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10887517.

Mavni commented 11 years ago

Hi Bill,

Thanks for the reply and GL with the apartment moving... I have downloaded the libraries and checked the 1640s before using your code I have SOME information on them, like AP course and some "000" I still haven't figured out what they stand for I'm trying to understand how I can edit the placement of the data on my 1640s

I hope i'm being clear enough...

I want to be able to choose where specific data will be showed, ie: if the 1640s have 16 digit display, I want to choose where the "AP course", "AP Heading" and "IAS" within those 16 digits

I don't want to bother your while moving, So take your time answering...

Thanks again

Michael

RB211 commented 11 years ago

Fear not, that is easy to fix. Look at the very near bottom, there's a section where output 1.and output2 are defined. On Nov 30, 2012 1:18 PM, "Mavni" notifications@github.com wrote:

Hi Bill,

Thanks for the reply and GL with the apartment moving... I have downloaded the libraries and checked the 1640s before using your code I have SOME information on them, like AP course and some "000" I still haven't figured out what they stand for I'm trying to understand how I can edit the placement of the data on my 1640s

I hope i'm being clear enough...

I want to be able to choose where specific data will be showed, ie: if the 1640s have 16 digit display, I want to choose where the "AP course", "AP Heading" and "IAS" within those 16 digits

I don't want to bother your while moving, So take your time answering...

Thanks again

Michael

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10904248.

Mavni commented 11 years ago

Do you mean this:

if (output != outputold || output2 != output2old){ module1.setDisplayToString(output); module2.setDisplayToString(output2, 0b0000000000001000); outputold = output; output2old = output2;

?

RB211 commented 11 years ago

Before that, output1 =. Etc On Nov 30, 2012 2:06 PM, "Mavni" notifications@github.com wrote:

Do you mean this:

if (output != outputold || output2 != output2old){ module1.setDisplayToString(output); module2.setDisplayToString(output2, 0b0000000000001000); outputold = output; output2old = output2;

?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10905909.

Mavni commented 11 years ago

OK, you mean this

//Display LED Section - duh! if(i == 1){

  output = apcrsold;
  output += " ";
  output += apmachsetold;
  output += " ";
  output += aphdgsetold;
  output += " ";
  output += apaltold;

  output2 = apvsold;
  output2 += " ";
  output2 += apcrsold;
  output2 += " ";
  output2 += nav1old; 

So now my question is, How do I know what string to use for each data item? I understand that apvsold means Auto Pilot Vertical Speed, But how do I know the rest?

I saw this in the code:

"String oldpinStateSTR, pinStateSTR, stringnewstate, stringoldstate, aphdgset, aphdgsetold, apcrs, apcrsold, output, outputold, apalt, apaltold, apairspeed, apairspeedold, apmachset, apmachsetold;

String nav1, nav1old, nav2, nav2old, output2, output2old, apvs, apvsold, apActive, apActiveOld, machIas, machIasOld, altLock, altLockOld, headingLock, headingLockOld, atArmed, atArmedOld;

String apSpdAct, apSpdActOld, apAprAct, apAprActOld, apNavAct, apNavActOld;"

does this have something to do with what i'm looking for?

And one more question,

What's "old" ?

Thanks again, You're super helpful!

RB211 commented 11 years ago

Crs is course, mach is mach number, hdg is. Heading On Nov 30, 2012 3:17 PM, "Mavni" notifications@github.com wrote:

OK, you mean this

//Display LED Section - duh! if(i == 1){

output = apcrsold; output += " "; output += apmachsetold; output += " "; output += aphdgsetold; output += " "; output += apaltold;

output2 = apvsold; output2 += " "; output2 += apcrsold; output2 += " "; output2 += nav1old;

So now my question is, How do I know what string to use for each data item? I understand that apvsold means Auto Pilot Vertical Speed, But how do I know the rest?

I saw this in the code:

"String oldpinStateSTR, pinStateSTR, stringnewstate, stringoldstate, aphdgset, aphdgsetold, apcrs, apcrsold, output, outputold, apalt, apaltold, apairspeed, apairspeedold, apmachset, apmachsetold;

String nav1, nav1old, nav2, nav2old, output2, output2old, apvs, apvsold, apActive, apActiveOld, machIas, machIasOld, altLock, altLockOld, headingLock, headingLockOld, atArmed, atArmedOld;

String apSpdAct, apSpdActOld, apAprAct, apAprActOld, apNavAct, apNavActOld;"

does this have something to do with what i'm looking for?

And one more question,

What's "old" ?

Thanks again, You're super helpful!

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908040.

RB211 commented 11 years ago

NAV1 is obs1, although is altitude On Nov 30, 2012 3:17 PM, "Mavni" notifications@github.com wrote:

OK, you mean this

//Display LED Section - duh! if(i == 1){

output = apcrsold; output += " "; output += apmachsetold; output += " "; output += aphdgsetold; output += " "; output += apaltold;

output2 = apvsold; output2 += " "; output2 += apcrsold; output2 += " "; output2 += nav1old;

So now my question is, How do I know what string to use for each data item? I understand that apvsold means Auto Pilot Vertical Speed, But how do I know the rest?

I saw this in the code:

"String oldpinStateSTR, pinStateSTR, stringnewstate, stringoldstate, aphdgset, aphdgsetold, apcrs, apcrsold, output, outputold, apalt, apaltold, apairspeed, apairspeedold, apmachset, apmachsetold;

String nav1, nav1old, nav2, nav2old, output2, output2old, apvs, apvsold, apActive, apActiveOld, machIas, machIasOld, altLock, altLockOld, headingLock, headingLockOld, atArmed, atArmedOld;

String apSpdAct, apSpdActOld, apAprAct, apAprActOld, apNavAct, apNavActOld;"

does this have something to do with what i'm looking for?

And one more question,

What's "old" ?

Thanks again, You're super helpful!

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908040.

RB211 commented 11 years ago

Old is probably not the best name for it. The current state and old state, it changes the display only when something changes On Nov 30, 2012 3:17 PM, "Mavni" notifications@github.com wrote:

OK, you mean this

//Display LED Section - duh! if(i == 1){

output = apcrsold; output += " "; output += apmachsetold; output += " "; output += aphdgsetold; output += " "; output += apaltold;

output2 = apvsold; output2 += " "; output2 += apcrsold; output2 += " "; output2 += nav1old;

So now my question is, How do I know what string to use for each data item? I understand that apvsold means Auto Pilot Vertical Speed, But how do I know the rest?

I saw this in the code:

"String oldpinStateSTR, pinStateSTR, stringnewstate, stringoldstate, aphdgset, aphdgsetold, apcrs, apcrsold, output, outputold, apalt, apaltold, apairspeed, apairspeedold, apmachset, apmachsetold;

String nav1, nav1old, nav2, nav2old, output2, output2old, apvs, apvsold, apActive, apActiveOld, machIas, machIasOld, altLock, altLockOld, headingLock, headingLockOld, atArmed, atArmedOld;

String apSpdAct, apSpdActOld, apAprAct, apAprActOld, apNavAct, apNavActOld;"

does this have something to do with what i'm looking for?

And one more question,

What's "old" ?

Thanks again, You're super helpful!

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908040.

Mavni commented 11 years ago

Yeah, those are the easy ones, What about Nav1 S/B, or COM1?

RB211 commented 11 years ago

NAV1 is navigation radio, com is com 1 radio. Sb is standby freq. On Nov 30, 2012 3:23 PM, "Mavni" notifications@github.com wrote:

Yeah, those are the easy ones, What about Nav1 S/B, or COM1?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908217.

Mavni commented 11 years ago

I'm not sure i'm getting you,

If I want to display the COM1 standby frequency,

What do i write

output = apcrs; output += " "; output += HERE; output += " "; output += aphdgsetold; output += " "; output += apaltold;

"com1old" does not compile for example

How do I know what the proper string is for everything?

RB211 commented 11 years ago

That code was never finished. Future work On Nov 30, 2012 3:40 PM, "Mavni" notifications@github.com wrote:

I'm not sure i'm getting you,

If I want to display the COM1 standby frequency,

What do i write

output = apcrs; output += " "; output += HERE; output += " "; output += aphdgsetold; output += " "; output += apaltold;

"com1old" does not compile for example

How do I know what the proper string is for everything?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908674.

Mavni commented 11 years ago

Now I understand... So whatever works, you say :)

So basically, What I asked about the three "string" rows is true? Those are the available values to use?

RB211 commented 11 years ago

Those are simply creating the strings into memory. You can delete what you don't need and add your own On Nov 30, 2012 3:48 PM, "Mavni" notifications@github.com wrote:

Now I understand... So whatever works, you say :)

So basically, What I asked about the three "string" rows is true? Those are the available values to use?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10908850.

Mavni commented 11 years ago

OK, I think i'm starting to get it...

Thanks a lot for your help :+1:

I really appreciate it!

Mavni commented 11 years ago

Hi Again!

I hope you had a quick and easy moving...

I think I figured out most of the code, I even managed to add some more data to the display, such as NAV1 S/B

Now I'm trying to connect my E37 rotary encoder, But something is not clear to me,

You defined pins 54-69 for the encoder, But of course there are no such pins on the Mega, And I can't find any mapping in the code.

I tried changing that, But it didn't work

Am I missing something?

Thanks again

RB211 commented 11 years ago

The analog pins can be used as digital inputs thus those numbering are valid On Dec 1, 2012 1:45 AM, "Mavni" notifications@github.com wrote:

Hi Again!

I hope you had a quick and easy moving...

I think I figured out most of the code, I even managed to add some more data to the display, such as NAV1 S/B

Now I'm trying to connect my E37 rotary encoder, But something is not clear to me,

You defined pins 54-69 for the encoder, But of course there are no such pins on the Mega, And I can't find any mapping in the code.

I tried changing that, But it didn't work

Am I missing something?

Thanks again

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-10915359.

Mavni commented 11 years ago

Hi again, Bill!

Thanks for your help with everything, I got everything working except for the rotary encoders... I have a couple of Elma E37s, and I'm trying to use them with your code but to no avail... The farthest I got with it was when I got ON & OFF signals when turning, but no direction was identified, Meaning, if I turned the encoder, it was like turning a switch ON & OFF, no matter which direction I turned it...

Now I can't even get that working...

I used this information to connect it: http://www.leobodnar.com/products/BU0836X/ELMA-BU0836X.gif

Do you have an idea what to check?

Thanks again... Michael

RB211 commented 11 years ago

Make sure your plunging the wires into the correct ports. Don't change the port assignments as I tried to make sure each one had one interrupt for better performance. On Dec 27, 2012 11:13 AM, "Mavni" notifications@github.com wrote:

Hi again, Bill!

Thanks for your help with everything, I got everything working except for the rotary encoders... I have a couple of Elma E37s, and I'm trying to use them with your code but to no avail... The farthest I got with it was when I got ON & OFF signals when turning, but no direction was identified, Meaning, if I turned the encoder, it was like turning a switch ON & OFF, no matter which direction I turned it...

Now I can't even get that working...

I used this information to connect it: http://www.leobodnar.com/products/BU0836X/ELMA-BU0836X.gif

Do you have an idea what to check?

Thanks again... Michael

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-11711254.

Mavni commented 11 years ago

My encoder is connected directly to pins 54-55 and GND, and I get NOTHING on Link2FS... I also tried using 10K resistors, as it said on the datasheet, still nothing

Got any other idea?

RB211 commented 11 years ago

There are many different types of encoders with different outputs. At one point in time you had them working? Load up an example rotary encoder program that spits out serial data, and use that simple example program to troubleshoot your encoders before trying my larger program.

On Thu, Dec 27, 2012 at 6:10 PM, Mavni notifications@github.com wrote:

My encoder is connected directly to pins 54-55 and GND, and I get NOTHING on Link2FS... I also tried using 10K resistors, as it said on the datasheet, still nothing

Got any other idea?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-11720918.

Mavni commented 11 years ago

OK, an update, After tweaking and tinkering, I got it working on pins 6,7, but not on pins >53

I thought I probably messed up your code, so I tried using your original code, and still nothing on ping >53

Could this be a problem in your code that my N00Bish eye missed?

RB211 commented 11 years ago

Thinking back now, I believe I modified his library so it would work with a higher pin count, like on the ArduinoMega. There is a simple line you change in one of the header files... I am going to have to search for it, or you could do a search on it and play with it.

On Friday, December 28, 2012, Mavni wrote:

OK, an update, After tweaking and tinkering, I got it working on pins 6,7, but not on pins >53

I thought I probably messed up your code, so I tried using your original code, and still nothing on ping >53

Could this be a problem in your code that my N00Bish eye missed?

— Reply to this email directly or view it on GitHubhttps://github.com/RB211/apControl/issues/1#issuecomment-11730408.