Skip to content

Add support for Arduino MKR WiFi 1010 #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define PIN_TO_SERVO(p) ((p) - 2)


// Arduino/Genuino MKR1000
#elif defined(ARDUINO_SAMD_MKR1000)
// Arduino/Genuino MKR1000 or MKR1010
#elif defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010)
#define TOTAL_ANALOG_PINS 7
#define TOTAL_PINS 22 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) <= 21)
Expand Down
3 changes: 3 additions & 0 deletions examples/StandardFirmataWiFi/StandardFirmataWiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Arduino WiFi Shield (or clone)
- Arduino WiFi Shield 101
- Arduino MKR1000 board
- Arduino MKRWIFI1010 board
- ESP8266 WiFi board compatible with ESP8266 Arduino core

Follow the instructions in the wifiConfig.h file (wifiConfig.h tab in Arduino IDE) to
Expand Down Expand Up @@ -929,6 +930,8 @@ void initTransport()
DEBUG_PRINTLN( "using the ESP8266 WiFi library." );
#elif defined(HUZZAH_WIFI)
DEBUG_PRINTLN( "using the HUZZAH WiFi library." );
#elif defined(WIFI_NINA)
DEBUG_PRINTLN( "using the WiFi NINA library." );
//else should never happen here as error-checking in wifiConfig.h will catch this
#endif //defined(WIFI_101)

Expand Down
35 changes: 35 additions & 0 deletions examples/StandardFirmataWiFi/wifiConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,41 @@
* For HUZZAH with ESP8266 use ESP8266_WIFI.
*/

/*
* OPTION E: Configure for Arduino MKR WiFi 1010 and maybe other WiFiNINA boards.
*
* This will configure StandardFirmataWiFi to use the WiFiNINA library, which works with the
* boards that have the U-Blox NINA chip built in (such as the MKR1010).
* It is compatible with 802.11 2.4GHz B/G/N networks.
*
* If you are using the MKR1010 board, continue on to STEP 2. If you are using WiFiNINA add-on
* boards, follow the instructions below.
*
* To enable for WiFiNINA add-on boards, uncomment the #define WIFI_NINA below.
* TBD: Adafruit AirLyft boards are based on the WiFiNINA firmware so may work here.
*
* IMPORTANT: You must have the WiFI NINA library installed. To easily install this library, open
* the library manager via: Arduino IDE Menus: Sketch > Include Library > Manage Libraries > filter
* search for "WiFiNINA" > Select the result and click 'install'
*/
//#define WIFI_NINA

//do not modify the following 15 lines
#if defined(ARDUINO_SAMD_MKRWIFI1010) && !defined(WIFI_NINA)
// automatically include if compiling for MRKWIFI1010
#define WIFI_NINA
#endif
#ifdef WIFI_NINA
#include <WiFiNINA.h>
#include "utility/WiFiClientStream.h"
#include "utility/WiFiServerStream.h"
#ifdef WIFI_LIB_INCLUDED
#define MULTIPLE_WIFI_LIB_INCLUDES
#else
#define WIFI_LIB_INCLUDED
#endif
#endif

//------------------------------
// TODO
//------------------------------
Expand Down