Adafruit BlueFruit LE Guide Utilisateur page 20

Table des Matières

Publicité

work just fine with flow-control and we do have that available at the cost of a single GPIO pin.
For software serial (Arduino Uno, Adafruit Metro) you should uncomment the software serial contructor below, and make sure the
other three options (hardware serial & SPI) are commented out.
// Create the bluefruit object, either software serial...uncomment these lines
SoftwareSerial bluefruitSS
=
SoftwareSerial(BLUEFRUIT_SWUART_TXD_PIN, BLUEFRUIT_SWUART_RXD_PIN);
Adafruit_BluefruitLE_UART ble(bluefruitSS, BLUEFRUIT_UART_MODE_PIN,
BLUEFRUIT_UART_CTS_PIN, BLUEFRUIT_UART_RTS_PIN);
For boards that require hardware serial (Adafruit Flora, etc.), uncomment the hardware serial constructor, and make sure the other
three options are commented out
/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
Carte de type SPI (Bluefruit LE SPI Friend)
For SPI based boards, you should uncomment the hardware SPI constructor below, making sure the other constructors are
commented out:
/* ...hardware SPI, using SCK/MOSI/MISO hardware SPI pins and then user selected CS/IRQ/RST */
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
If for some reason you can't use HW SPI, you can switch to software mode to bit-bang the SPI transfers via the following constructor:
/* ...software SPI, using SCK/MOSI/MISO user-defined SPI pins and then user selected CS/IRQ/RST */
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_SCK, BLUEFRUIT_SPI_MISO,
BLUEFRUIT_SPI_MOSI, BLUEFRUIT_SPI_CS,
BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);

Publicité

Table des Matières
loading

Table des Matières