Modifications

Sauter à la navigation Sauter à la recherche
481 octets ajoutés ,  30 octobre 2018 à 19:22
Ligne 89 : Ligne 89 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
Then, it defines the parameters for the radio module and the pinout used to wire the RFM69HCW radio module depending on the board used.
+
Then, it defines the parameters for the radio module and the pinout used to wire the RFM69HCW radio. The code adapt himself to the the board selected in the compiler.
    
The last line create the object {{fname|rf69}} to control the module.  
 
The last line create the object {{fname|rf69}} to control the module.  
Ligne 184 : Ligne 184 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
xxxx
+
The main {{fname|loop()}} function just check if a new message arrives.
    +
If so, it read the message and store it into {{fname|buf}} buffer.
 +
 +
Then, several {{fname|Serial.print()}} statement are used to send the data over the serial connexion.
 +
 +
Finally, the sketch sends an '''ACK''' confirmation message.
 +
 
<syntaxhighlight lang="c">
 
<syntaxhighlight lang="c">
 
void loop() {
 
void loop() {
Ligne 214 : Ligne 220 :  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
The {{fname|Blink()}} function is used to signal error code (blink once when a message received, blink 3 times when having a communication error).
    
<syntaxhighlight lang="c">
 
<syntaxhighlight lang="c">
29 836

modifications

Menu de navigation