- 29
Jan - 2017MicroPython
2 min | 8323Table of contentShowHi again!... First of all:
![Happy Chinese New Year!!!]()
I've just uploaded some code for the Wipy 2.0. I wanted to write some python code. That was why I took the Wipy 2.0 and programmed something like a weather report box. In this project the Wipy 2.0 reads the GPS coordinates via UART, then makes a web get request using the API of openweathermap, and after that the results are displayed on a LCD.
If you like this, please leave a comment, share and/or like! It would be very much appreciated!
![Python]()
Code: https://goo.gl/v7NCkj Things used in this project
Hardware components
(*) For this project I used the Ublox NEO-6M but you should probably buy the new NEO-M8N (see here)
Software apps and online services:
Wiring
Wipy 2.0 NEO-6M ST7735 3.3vVCCVCCGNDGNDGNDP3(G12)RXP4(G11)TXP6(G13)RESP7(G14)RS/DCP8(G15)CSP10(G17)SCLP11(G22)SDAThese are the default connection setting, you can change them using the constructor of the
Displayclass asmy_display = Display(self, uSPI=0, pinDC='P7', pinCS='P8', pinRST='P6')Instructions
- Download the complete Github repository
- Update your Wipy firmware
- Register on
Open Weather Map API to get an API key. - Connect the GPS module and the ST7735 display as indicated in the Wiring section.
- Modify the
boot.pyfile to enter yourSSIDandWPApassword.- Note: the firmware (1.5.0.b2 and I think early versions too) has a bug and the DNS server is not set if you use static IP address and this is needed to resolve the get request.
- Modify the
main.pyfile to include your API key:APIvariable underupdatingWeather(self, my_gps, my_display)method -line 40-. - Optional: change the GPS and Weather update rates in milliseconds in the
main.pyfile:UPDATE_GPS = const(10000)(default = 10 seconds)UPDATE_WEATHER = const(50000)(default = 50 seconds)
- Copy the all the files to the flash memory of the Wipy 2.0 and restart the board.
Preview
Changelog
- Revision 0.1b
Credits
- GPS library forked from: https://github.com/inmcm/micropyGPS
- ST7735 library rewriten from: http://forum.43oh.com/topic/4352-universal-color-lcd-graphics-library-2/
We use cookies to improve our services. Read more about how we use cookies and how you can refuse them.










Empty