Modifications

Sauter à la navigation Sauter à la recherche
Ligne 331 : Ligne 331 :  
## Turn of the LED
 
## Turn of the LED
   −
{{underline|'''Reading sensor data:'''}}}
+
{{underline|'''Reading sensor data:'''}}
    
Reading the BMP280 sensor data relies on the {{fname|bme280.py} library previously detailled.
 
Reading the BMP280 sensor data relies on the {{fname|bme280.py} library previously detailled.
Ligne 346 : Ligne 346 :     
Next the mainloop do prepare the string message (variable {{fname|msg}} by using the powerful Python string formatting feature.
 
Next the mainloop do prepare the string message (variable {{fname|msg}} by using the powerful Python string formatting feature.
 +
 +
{{underline|'''Formatting data:'''}}
    
This can be done with one single line. Notice the expression {{fname|time.time()-ctime}} calculating the elapse time (in second) since the mainloop started.   
 
This can be done with one single line. Notice the expression {{fname|time.time()-ctime}} calculating the elapse time (in second) since the mainloop started.   
Ligne 352 : Ligne 354 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
led.on() # Led ON while sending data
+
{{underline|'''Sending data:'''}}
print( msg )
+
 
# Send a packet without ACK - Send it, don't care if it is received or not
+
The onboard LED is switched on during data transmission (and print). This makes the LED flashing briefly while data us transmitted.
rfm.send(bytes(msg , "utf-8") )
+
 
led.off()
+
The data packet are sent without ACK, this would avoids unnecessary latency by waiting for ACK. Indeed, the Cansat will not modifies its behaviours if the data are not received on the ground station.
 +
 
 +
<syntaxhighlight lang="python">led.on() # Led ON while sending data
 +
print( msg )
 +
# Send a packet without ACK - Send it, don't care if it is received or not
 +
rfm.send(bytes(msg , "utf-8") )
 +
led.off()
 +
</syntaxhighlight>
    
== Fault tolerant design ==
 
== Fault tolerant design ==
29 917

modifications

Menu de navigation