Modifications

Sauter à la navigation Sauter à la recherche
2 237 octets ajoutés ,  21 mai 2017 à 15:57
Page créée avec « {{Bluefruit-LE-Shield-NAV}} {{traduction}} == Croquis ATCommand == The ATCommand example allows you to execute AT commands from your sketch, and see the results in the Se... »
{{Bluefruit-LE-Shield-NAV}}

{{traduction}}
== Croquis ATCommand ==
The ATCommand example allows you to execute AT commands from your sketch, and see the results in the Serial Monitor. This can be useful for debugging, or just testing different commands out to see how they work in the real world. It's a good one to start with!

== Ouvrir le croquis ==
To open the ATCommand sketch, click on the '''File > Examples > Adafruit_BluefruitLE_nRF51''' folder in the Arduino IDE and select '''atcommand''':

{{ADFImage|Bluefruit-LE-Shield-ATCommand-00.png}}

This will open up a new instance of the example in the IDE, as shown below:

{{ADFImage|Bluefruit-LE-Shield-ATCommand-01.png}}

== Configuration ==
Check the '''Configuration'''! page earlier to set up the sketch for Software/Hardware UART or Software/Hardware SPI. The default is hardware SPI

If using software or hardware Serial UART:
* This tutorial does not need to use the MODE pin, '''make sure you have the mode switch in CMD mode''' if you do not configure & connect a MODE pin
* Don't forget to also '''connect the CTS pin on the Bluefruit to ground if you are not using it!''' (The Flora has this already done)

== Exécuter le croquis ==
Once you upload the sketch to your board (via the arrow-shaped upload icon), and the upload process has finished, open up the Serial Monitor via '''Tools > Serial Monitor''', and make sure that the baud rate in the lower right-hand corner is set to '''115200''':

{{ADFImage|Bluefruit-LE-Shield-ATCommand-10.png}}

To send an AT command to the Bluefruit LE module, enter the command in the textbox at the top of the Serial Monitor and click the Send button

{{ADFImage|Bluefruit-LE-Shield-ATCommand-11.png}}

The response to the AT command will be displayed in the main part of the Serial Monitor. The response from "'''ATI'''" is shown below:

{{ADFImage|Bluefruit-LE-Shield-ATCommand-12.png}}

You can do pretty much anything at this prompt, with the AT command set. Try '''AT+HELP''' to get a list of all commands, and try out ones like '''AT+HWGETDIETEMP''' (get temperature at the nRF51822 die) and '''AT+HWRANDOM''' (generate a random number)

{{ADFImage|Bluefruit-LE-Shield-ATCommand-13.png}}

{{Bluefruit-LE-Shield-TRAILER}}
29 918

modifications

Menu de navigation