• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Open weathermap lat’ and long

Q&A Forum › Category: ESP8266 › Open weathermap lat’ and long
0 Vote Up Vote Down
Steve asked 4 years ago

Been successful with the API Openweathermap project I wanted to change to lat long co-ordinates instead of City and Country code.
Has this been covered anywhere?
If not please can someone give me a few pointers as to where I start
Thanks
Steve

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.

You need to change your script to get the longitude and latitude. You can get them like this:

latitude = weather_data.json().get('coord').get('lon')
longitude = weather_data.json().get('coord').get('lat')

Then, display it in the OLED as you wish.

I hope this helps.

Regards,
Sara

0 Vote Up Vote Down
Steve answered 4 years ago

Hi Sara
Thank you
Steve

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

I’ll close this issue.
If you need further help, just open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.