Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some changes to support a different display #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

soharddbwarez
Copy link

I had to make quite significant changes to the your code to get it working with my smaller LCD display.

At first it looked like you made the graphics scalable with minimal changes but that wasn't the case so I had to figure out first what each value was at all the various places and what it does on the display, then change one little thing at a time, upload the sketch and look what changed, instead of being able to use scaling I had to resort to completely reverse engineer your code because you didn't comment in which value does what at the specific places.

I made it so far that the graphics fit on my smaller display but I eventually gave up with the analog humidity meter at the top of the display because to figure that out I had to put too much of my time into this project if I want it to show up perfectly centered and scaled to my display.

So I got it almost perfect and I can live with the needle not perfectly aligned and centered and the scale of the analog half circled bar just a bit off.

Got it running this way for a few years now so you might want to add my code to yours so there's support for a different and smaller display which is 240x320 pixels.

Best regards.

I'm adding my code to the project specifically for: 
Using the ASAIR AM2302 (DHT22) Temp/Humidity sensor with a Velleman VMA412 2.8" 240x320 resistive touch screen
Draws a thermometer bulb graphic with two buttons for you to choose to display the temperature in
degree Celsius or Fahrenheit and shows humidity on an analog meter needle display.

Turns out that I had to make a lot of changes to the sketch made by GadgetReboot to make it usable on my display
the only thing that I have in common is that analog pin 5 isn't used on my shield also, changing it to a digital pin number 19
makes it usable for the sensor... However that's about it, my calibration is completely different in pin usage, the most outer
touch values and usable pixels.
Therefore I had to rewrite pretty much the whole sketch because for me it's completely unusable as is.
It's not perfect yet but at least I managed to get the proportions better so now it starts to fit on the screen, I still need to figure out
a couple things because I don't really know what I'm doing so I have to learn by changing one thing, then upload the sketch to see
what changed which is a lot of work and takes a long time but my added sketch will be usable for anyone with a similar display that I'm using.
Better commented out what I changed, kept most of the old values for reference
in the comment sections.
All graphical stuff except the analog needle position is now scaled down properly
so it fits nicely on the screen, buttons work and are given a new position.
The numerical box is now also changed to fit the screen and I now have the correct
position for the header text, the temperature and humidity values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant