Alex's Corner - Week 6 - Best Practices for Deployment
-
@PiAir
this is about voltage/state indicator
IRQ_LOW_LEVEL0
IRQ_HIGH_LEVEL1 - 3V3
IRQ_FALLING- The falling edge of the signal
IRQ_RISING- The rising edge of the signal -
@livius Ok...but when would I prefer using IRQ_HIGH_LEVEL over IRQ_RISING in an interrupt? Is it just there for redundancy or are there specific use case that would make you use one or the other?
-
@PiAir
You can add or between and fire in both cases :-)
e.g.Pin.IRQ_FALLING | Pin.IRQ_RISINGare there specific use case
This depend - e.g. how fast signal raisin/falling -
Hi Alex,
Thank you for posting these tutorial videos, I find them very useful.
You refer to using a configuration file for wifi password, UUID etc., I would be grateful if you would outline the structure of this file as I would like to use this technique, but am unsure how to create such a file.Regards,
Mervyn
-
@tenspot have a look at this config.py and this file that uses it.
Basically the config.py is a .py file where you declare the variables:
GATEWAY_ID = '11aa334455bb7788' SERVER = 'router.eu.thethings.network' PORT = 1700 NTP = "pool.ntp.org" NTP_PERIOD_S = 3600` WIFI_SSID = 'my-wifi' WIFI_PASS = 'my-wifi-password'Then, if you want to use them in another python file, you import it using:
import configAfter that you can address any variable that you have defined in that config.py file like (for example):
config.WIFI_SSIDetc
-
@tenspot It's also a convention to write the constant 'variables' in all uppercase.
-
@PiAir Hi, Thanks for your reply, I didn't realise it was that simple! Thanks to Rob also for your comment on capitalisation of constants. Knowledge of these things all helps to improve my code readability and style.
-
Hi @tenspot, apologies for the delay getting back to you, I have been busy with events this week! Thanks @RobTuDelft and @PiAir for answering these questions!
-
@bucknall No problem. Thanks again for the video tutorials.
-
@tenspot You're welcome. And if you like video tutorials, I can also recommend the ones by Tony DiCola from Adafruit. Although they are not LoPy/Pycom specific (he often uses the Adafruit boards) they are very informative. That is how I learned microPython:
https://www.youtube.com/playlist?list=PLjF7R1fz_OOXrI15wuXeESA0aA4VzcWSi
-
@PiAir Thanks for the link, I will check it out.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login