MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
RJPotts
Posts: 13
Supporter
Hi,

I've just tried connecting an LCD and I'm having no luck at all.......

The unit in question has an HD44780 controller. The jumper solder pads (A0, A1, A2) are all open. As per the guidance in https://www.mobiflight.com/forum/message/5834.html I'm using 0x27, columns are set to 16 & lines to 2. This address is also mentioned in the item details (https://www.amazon.co.uk/gp/product/B08218RPX6/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&th=1).

The unit is connected (to a Mega 2560) as follows;

GND - GND (below 53)
VCC - 5V (pin above 22)
SDA - 20
SCL - 21

The display is lighting up but I cant get it to display anything, not even with the test function.

Does anyone know where I might be going wrong please?

Thanks & best regards
Richard
2021-04-07 21:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
Hi

Do you got the "Mobiflight Rocks" message at startup from Mega ( before you start MF) ?

If not check the Pin Setting and also confirm the Adress.
And NOTE: After add a new device then a Restart of Mega is sometimes needed.
(Restart means unpower the Mega..... So fully Disconnect/Reconnect from USB or press the RESET Button on the Board ! )
Good Luck !
2021-04-07 21:35
Avatar
RJPotts
Posts: 13
Supporter
Hi,

Thanks for the message.

I do not see the 'Mobiflight Rocks' message when the mega is powered on.

The pin assignments are definitely as above, I've just checked (again haha) with a magnifying glass. As well as 0x27 I've tried 0x3F (mentioned also in the Amazon advert) and I've also tried both different cables as well as a different LCD unit (I bought two), all without anything being displayed on the screen, although it is powered / backlit. I've restarted the mega both by disconnecting / reconnecting the USB as well as the reset button on the board.

Best regards & again, many thanks
Richard
2021-04-07 21:49
Avatar
RJPotts
Posts: 13
Supporter
A bit of additional info........

Using the guide at https://www.youtube.com/watch?v=IaqPrgDDr1g I was able to verify that 0x27 is the correct address. That test find the LCD module :-/

Best regards
Richard
2021-04-07 22:39
Avatar
RJPotts
Posts: 13
Supporter
Arrrrrrgggggggggghhhhhhhhhhhhhhhhhh!!!!!!!!!!!

Screen contrast................ fiddled with the potentiometer and got a display.

I still don't know for sure if I'll be building a cockpit but if I do it's unlikely to be anything modern. What I'd quite like to do is turn an LCD into the CDI for the GPS, like the very early units which display like: '-------O-------' for an aircraft on track, '-----O-I-------' for an aircraft slightly left of track, '-O-----I-------' for an aircraft left of track by a lot. Could that be feasible?

Best regards & apologies for not trying that potentiometer sooner!
Richard
2021-04-07 23:07
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
Yeah the contrast.... I missed to say. Happend also to me. Looks like new brands always are set by manifactur to lowest (off) contrast!

Your Idea....
Verry difficult !

Whatever with a good IF ELSE Logic a lot of things are possible.... But i will say this is not the thing we normaly do with our current system !

EDIT: To be clear.... Something like LEFT - CENTER -RIGHT is possible..... Also something like ... Hard LEft - Left -Center -Right -Hardright is pretty sure a easy workaaround.
But a System with 3 or more indications on each side grows up the system extremly......

Call me if your ready.... Then we try out to build this. Pretty sure verry advanced IF Condition is needed..... But i basicly know what to do !
Good Luck !
2021-04-08 08:28
Avatar
RJPotts
Posts: 13
Supporter
I guess it's a bit of info to tuck away for the future..... if I do end up building a proper cockpit then one day an LCD won't work and I'll know why haha :)

I work quite a lot in Excel so I might try the logic in there & then see if I can translate it (if required) to mobiflight....... hopefully the cross-track offset is negative for one side & positive for the other side. I'll let you know how I get on.

Many thanks & best regards
Richard
2021-04-08 09:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
The key will be the String Output.....

Read e.g. current heading and selected heading.... Or Position related to a VOR is no Problem.
Not care about the form of this Values ( -xx to + xxx OR 0-256 e.g.) We can easy calculate the "offset" between 2 Values without any trouble.....

The final problem is.... The Data on the LCD is a fixed String ! ......
Means we must send the String in one Output.

For example we have 3 Situations..... ( LEFT CENTER RIGHT) ..... -------O------- : --O------------ : ------------O--
Then we need a if condition that say... if(a=1,'-------O-------',if(a=2,'--O------------',' ------------O-- '))

As more conditions as longer the formula.... And pretty sure there is finaly a limit.

May we can also trick and work with multiple Placehodlers.....
So Display show something like .... --%--&--#--§--?--
So we just define the 5 Placeholders as "-" or "O" with 5 individual Configs.

As i say.... Possible but difficult !
Good Luck !
2021-04-08 11:27
Avatar
RJPotts
Posts: 13
Supporter
Offset 0x6058 gives the cross track distance in metres (positive for left of track & negative for right of track), divide it by 1852 & it's just what I wanted.

I tried a formula in Transform but couldn't get anything other than digits (I'm thinking that strings aren't possible in Transform?).

I then tried creating multiple Outputs, each with preconditions limiting them to only the upper & lower limits of each part of the scale, then with the display tab showing the O at the right point along the ---------- scale.

It works great!! I need to refine the scale, 1nm per division is probably a bit much but as there are preconditions for each division on the scale I can have a more accurate scale near the middle than the ends, much like a VOR CDI needle.





Many thanks for the help!!!

Best regards
Richard
2021-04-08 23:02
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
Your right... Strings are NOT possible within Transform ( at the moment.... We check to maybe change this pretty soon) ......
BUT
The Formulas ( you know from Transform) are also usable in the Compare Tab.... And THERE Strings and code like 'text' is possible !
Good Luck !
2021-04-09 19:25
Avatar
RJPotts
Posts: 13
Supporter
I decided to stick with the multiple outputs with (cross track distance) preconditions for each & it seems to work just as hoped.

I had some green & black LCD display modules arrive and it looks a bit better with those. Also took the opportunity to add direct track & distance.

2021-04-10 16:46
icon