Global Earthquake Display on ILI9341 TFT using ESP8266.
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
Thanks Marcello. I'm happy for Andy. This is what my screen looks like right now with his program:
Well, it looks better, the photo is not very good.You do not have the required permissions to view the files attached to this post.
- cicciocb
- Site Admin
- Posts: 1965
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 422 times
- Been thanked: 1310 times
- Contact:
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
No problem Armando[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Aug 09, 2021 6:19 pm Thanks Marcello. I'm happy for Andy. This is what my screen looks like right now with his program:
image.png
Well, it looks better, the photo is not very good.
- Electroguard
- Posts: 846
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 272 times
- Been thanked: 320 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
I'm afraid the Strait of Gibraltar is being shown on the wrong continent.
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
Right, Robin.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sun Aug 08, 2021 1:43 pm With more data from earthquakes, I see that my latitude-to-point conversion calculation "y" on the graph is not working correctly.
I have also tried without success with:However, the conversion for the x-axis does seem correct.Code: [Local Link Removed for Guests]
' Convert longitude and latitude of event to screen co-ordinates. x = cInt(convert.map(lon, -180, 180, 0, 480)) y = cInt(convert.map(lat, -90, 90, 0, 320)) y = (320 - y) + 52
Do any of you know the subject of geographic coordinates?
You can help me?
Currently the code I posted seems to correctly calculate the x-axis (longitude) value but fails on the y-axis (latitude).
I have to enter a conversion factor as latitude is not linear.
While waiting for Andy to dismiss his guests , I have obtained a csv file to treat in Excel and calculate the formula to be applied:
Code: [Local Link Removed for Guests]
file$ = "/latitud.txt"
for lat = -90 to 90 step 0.5
y = cInt(convert.map(lat, -90, 90, 0, 320))
line$ = str$(lat) + ";" + str$(y) + chr$(10)
file.append file$, line$
wlog line$
next lat
If something occurs to you, I'll listen to you.
https://www.myrapidq.it/public/latitud.xlsx
https://www.myrapidq.it/public/Nicaragua.jpeg
https://www.myrapidq.it/public/Indonesia.jpeg
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
Francesco, this is my last neuron taking a vacation.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Aug 09, 2021 11:02 pmNo problem Armando[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Aug 09, 2021 6:19 pm Thanks Marcello. I'm happy for Andy. This is what my screen looks like right now with his program:
image.png
Well, it looks better, the photo is not very good.
You do not have the required permissions to view the files attached to this post.
- Electroguard
- Posts: 846
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 272 times
- Been thanked: 320 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
Yeah 'Fernando, I'm sure Andy will sort you out as soon as he is able.
I only pointed out Strait of Gibraltar error in case it hadn't already been noticed, whereas it was immediately apparent to me cos I used to see Gibraltar every day when I lived in Estepona Spain.
I hope your neuron has not gone to Gib for holiday cos the border queues were horrendous so you might not get it back for a while!
I only pointed out Strait of Gibraltar error in case it hadn't already been noticed, whereas it was immediately apparent to me cos I used to see Gibraltar every day when I lived in Estepona Spain.
I hope your neuron has not gone to Gib for holiday cos the border queues were horrendous so you might not get it back for a while!
- cicciocb
- Site Admin
- Posts: 1965
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 422 times
- Been thanked: 1310 times
- Contact:
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
The map should be calibrated.
Are you able to superpose some kind of latitude reference on the map ?
Taking into account the latitude reference, a calibration map could be created with linear interpolation or with a polynomial one
Are you able to superpose some kind of latitude reference on the map ?
Taking into account the latitude reference, a calibration map could be created with linear interpolation or with a polynomial one
- cicciocb
- Site Admin
- Posts: 1965
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 422 times
- Been thanked: 1310 times
- Contact:
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
This should be the latitude grid.
As you can see it is not linear
Using GIMP I extracted all the Y pixel position for each latitude :
As you can see it is not linear
Using GIMP I extracted all the Y pixel position for each latitude :
Code: [Local Link Removed for Guests]
Degrees | Y (pixel)
90 | 0
75 | 68
60 | 122
45 | 155
30 | 181
15 | 202
0 | 223
-15 | 243
-30 | 265
-45 | 290
-60 | 319
You do not have the required permissions to view the files attached to this post.
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
If I apply:
I get this:
Tonight I will have time to try to get the correlation.
Thanks, as always.
(We're not leaving Andy anything to do )
Code: [Local Link Removed for Guests]
y = cInt (convert.map (lat, -60, 90, 319, 0))
Thanks, as always.
(We're not leaving Andy anything to do )
You do not have the required permissions to view the files attached to this post.
- cicciocb
- Site Admin
- Posts: 1965
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 422 times
- Been thanked: 1310 times
- Contact:
Re: Global Earthquake Display on ILI9341 TFT. - From old forum.
I used an online service to determine the polynomial conversion parameters. https://planetcalc.com/
The conversion should be :
Seems complicate but it works; the error max is less than 2 pixels.
Simply copy and paste this line into Annex and that's all.
The conversion should be :
Code: [Local Link Removed for Guests]
Y = 2.78e-10 * lat^6 -2.5483e-8 * lat^5 -2.116389e-6 * lat^4 +2.5858636e-5 * lat^3 +3.483879e-3 * lat^2 -1.417675 * lat + 221.9496
Simply copy and paste this line into Annex and that's all.
Code: [Local Link Removed for Guests]
lat | y | ypoly6
===============================
-60 | 319 | 319.3412732
-45 | 290 | 288.778745
-30 | 265 | 266.0250102
-15 | 243 | 243.8266594
0 | 223 | 221.949551
15 | 202 | 201.4322453
30 | 181 | 181.1223806
45 | 155 | 156.4959924
60 | 122 | 120.7597748
75 | 68 | 68.23628393
90 | 0 | 0.032084131