Hello Jim, I have seen this issue many times and thank you for your email. That, in my opinion, is caused by a power loss/drop when the encoder is moved. These Ky-040 require 5v and I see you have them powered by an external unit. My first advice would be to remove the 5v into the Arduino. Keep the ground connection and let the Arduino be powered by the USB. Hopefully by an externally powered USB hub and not directly from a computer. Supplying power in at the pin requires slightly more than 5v for it to do anything when the USB is connected. That should get rid of any stray unwanted signals. See how that operates. My second suggestion would be to ditch the KY-040 encoders and use a them without the PCB boards. Mobiflight no longer requires the circuitry to operate. This means you don't need the extra ground or VCC into each encoder. leaving just three pins. This way they cant draw power when rotated. It also means without the PCB boards, there's much more room. Just trail that IAS encoder for test purposes and see how you get on. If your wondering pin assignment, the side with 3 pins on is, left -ard pin, centre-gnd, right-ard pin. If you have two pins on the encoder on the otherwise, they are for the push in switch. Gnd and ard pin. not required. One final thought, I never use dupoint jumpers for connecting 7 segment displays even when data. a loose or poor connection can cause havoc with the data lines also causing gobbledygook. But as yours is when you turn an encoder as it draws power, it's more power-related. A way to check that would be to remove the encioder and turn the IAS on the computer MCP and ensure the digits don't blank or go wibble. If they do, you then know its a data line connection problem. I Hope that helps. Kind Regards Karl (737DIYSIM)
@jimtalltheislandbrothers6639
4 жыл бұрын
Hi Karl. Thanks for your reply. I have tried a few things to no avail. I will give the simpler encoders a go and let you know how I get on. Having said that, I also unplugged the 7 segments and plugged them into a separate arduino. I then ran a basic example script for 7 segments and still gibberish. Difficult to believe that 4 of them could be bad though. Will keep you posted on my progress. I have to say your project is a huge inspiration. I am hoping to get my kids interested into flying but we will see how that goes. Regards Jim
@jimtalltheislandbrothers6639
4 жыл бұрын
Hi Karl. You saved the day. I was read g your comments about power. So I tried a simple thing which resolved the led issues. I was getting usb power from the front of the pc. I am now getting it from the back (I assume a more powerful port) and all leads work fine. The moment I add a single encoder it all goes haywire. So I will, as you suggested, get some simple encoders and all should be good. Thanks for your guidance. Regards Jim
@jimtalltheislandbrothers6639
4 жыл бұрын
And I can confirm with power from the back of the pc even the ky-40 encoders are happily working.
@helimech8152
4 жыл бұрын
@@jimtalltheislandbrothers6639 awesome Jim. It's fantastic when you get it all working and now I bet your confidence has grown. Cant wait to see what you create! All the best karl
Пікірлер: 5