Initial commit#4
Conversation
| SSID = "A Industriosa" | ||
| PASS = "alfageme" No newline at end of file |
There was a problem hiding this comment.
Quizáis deixar aquí unas variables de exemplo, tipo <wifi_ssid> e <contrasinal_wifi>. Sei que non hai nada relevante na wifi pero bueno nunca está de máis 😄
| import json | ||
| from env_var import url, headers, SSID, PASS | ||
|
|
||
| def do_connect(SSID, PASSWORD): |
There was a problem hiding this comment.
As variables de entorno está ok en mayúsculas, pero os parámetros das funcións idealmente serían en minúsculas
| from env_var import url, headers, SSID, PASS | ||
|
|
||
| def do_connect(SSID, PASSWORD): | ||
| print('Conectando a la red', SSID +"...") |
There was a problem hiding this comment.
Dende Python 3.6 idealmente podes usar "string interpolation" (https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals)
print(f"Conectando a la red {SSID}...")
Noutro caso str.format() https://docs.python.org/3/library/stdtypes.html#str.format
| if(numero_pixels <= 4): | ||
| for i in range(3, int(numero_pixels) - 1, -1): | ||
| neo[i] = (0, 16, 0) | ||
| else: | ||
| for i in range(4,int(numero_pixels), 1): | ||
| neo[i] = (0, 16, 0) |
There was a problem hiding this comment.
Aquí pérdome un pouco con obxetivo 😅 , entendo que e a "barra de progreso"?, creo que teño que probar o código!
| neo.write() | ||
|
|
||
| led_onboard.value(not led_onboard.value()) | ||
| sleep(0.5) No newline at end of file |
There was a problem hiding this comment.
En Python sempre una liña en blanco o final do ficheiro 😸
No description provided.