Tuple trouble
-
if
>>>print(lora.stats())
gives me
(rx_timestamp=0, rssi=0, snr=0.0, sfrx=0, sftx=0, tx_trials=0, tx_power=20, tx_time_on_air=0, tx_counter=0, tx_frequency=0)
how come
print(lora.stats()[6])
gives me
20
and not 'tx_power=20' ?
-
@kjm lora.stats returns a named tuple. The values are either obtained by indexing or by access to its elements, like:
stats = lora.stats() print (stats.tx_power, "is the same as", stats[6])
-
It gives based on the indexing where you have given 6.