1

I am trying to create a software serial connection between Arduino Uno & Adafruit Feather M0 Bluefruit LE.

I am getting the following error in the M0 sketch:

Arduino: 1.8.1 (Windows 10), Board: "Adafruit Feather M0"

atcommand:60: error: 'SoftwareSerial' does not name a type

 SoftwareSerial bluefruitSS = SoftwareSerial(BLUEFRUIT_SWUART_TXD_PIN, BLUEFRUIT_SWUART_RXD_PIN);

 ^

atcommand:62: error: 'bluefruitSS' was not declared in this scope

 Adafruit_BluefruitLE_UART ble(bluefruitSS, BLUEFRUIT_UART_MODE_PIN,

                               ^

exit status 1
'SoftwareSerial' does not name a type

Here are the modifications I did to the atcommand sketch (in Adafruit BluefruitLE nRF51 library) before uploading to the M0:

#include <Arduino.h>
#include <SPI.h>
#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)
  #include <SoftwareSerial.h>
#endif

#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"
#include "Adafruit_BluefruitLE_UART.h"

#include "BluefruitConfig.h"


// 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);


/* ...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);

/* ...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);

/* ...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);

I tried to comment the if statement before #include <SoftwareSerial.h>, I got the following error:

Arduino: 1.8.1 (Windows 10), Board: "Adafruit Feather M0"

C:\Users\hadeel\AppData\Local\Temp\arduino_modified_sketch_612073\atcommand.ino:18:30: fatal error: SoftwareSerial.h: No such file or directory

   #include "SoftwareSerial.h"

                              ^

compilation terminated.

exit status 1
Error compiling for board Adafruit Feather M0.

What is the problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.