CC3000 WiFi shield mDNS and LED example

In this article we look at the CC3000 WiFi shield. We will use the aRest example for CC3000, and we will then use a web address to manipulate some LED’s on and off.

Lets look at the CC3000 chip

The TI CC3000 module is a self-contained wireless network processor that simplifies the implementation of Internet connectivity. TI’s SimpleLink Wi-Fi solution minimizes the software requirements of the host microcontroller (MCU) and is thus the ideal solution for embedded applications using any low-cost and low-power MCU.

The TI CC3000 module reduces development time, lowers manufacturing costs, saves board space, eases certification, and minimizes the RF expertise required. This complete platform solution includes software drivers, sample applications, API guide, user documentation, and a world-class support community.


  1. Arduino Uno and Arduino Mega  compatible
  2. Supports SD card sizes 2GB and 4GB
  3. Wireless network processor
    • IEEE 802.11 b/g ( 2.4GHz)
    • Embedded IPv4 TCP/IP stack
  4. Best-in-class radio performance
    • TX power: +18.0 dBm at 11 Mbps, CCK
    • RX sensitivity: –88 dBm, 8% PER, 11 Mbps
  5. Operating temperature: –20°C to 70°C
  6. SmartConfig technology enables simple Wi-Fi configuration using a smartphone, tablet or PC

Parts List

CC3000 WiFi Shield 1PCS CC3000 WiFi Shield for R3 With SD Card Supports MEGA2560
Arduino Mega 1pcs MEGA 2560 R3 ATmega2560 AVR USB board +free USB cable (ATMEGA2560 /CH340 ) funduino 2560
Dupont Wire 40PIN Dupont Line 10CM 20CM 30CM Male to Male + Female to Male and Female to Female Jumper Wire Dupont Cable for arduino DIY KIT
Traffic LED 5V Traffic Light LED Display Module for Arduino Red Yellow Green 5mm LED


We used a traffic light LED example connected to our CC3000 shield, something like this

cc3000 and MDNS led example_bb
cc3000 and MDNS led example_bb


This example requires several libraries to be installed


[codesyntax lang=”cpp”]

// Import required libraries
#include <Adafruit_CC3000.h>
#include <SPI.h>
#include <CC3000_MDNS.h>
#include <aREST.h>
#include <aREST_UI.h>
#include <avr/wdt.h>

// These are the pins for the CC3000 chip if you are using a breakout board
#define ADAFRUIT_CC3000_IRQ   3
#define ADAFRUIT_CC3000_VBAT  5
#define ADAFRUIT_CC3000_CS    10

// Create CC3000 instance
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIV2);
// Create aREST UI instance
aREST_UI rest = aREST_UI();
// Your WiFi SSID and password                                         
#define WLAN_SSID       "iainhendry"
#define WLAN_PASS       "iain061271"
// The port to listen for incoming TCP connections 
#define LISTEN_PORT           80
// Server instance
Adafruit_CC3000_Server restServer(LISTEN_PORT);
// DNS responder instance
MDNSResponder mdns;

void setup(void)
  // Start Serial
  // Give name and ID to device
  // Set up CC3000 and get connected to the wireless network.
  if (!cc3000.begin())
  if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {
  while (!cc3000.checkDHCP())
  // Start multicast DNS responder
  if (!mdns.begin("arduino", cc3000)) 
  // Start server
  Serial.println(F("Listening for connections..."));
  // Enable watchdog

void loop() 
  // Handle any multicast DNS requests
  // Handle REST calls
  Adafruit_CC3000_ClientRef client = restServer.available();
  // Check connection, reset if connection is lost




Open your favourite web browser


You should see the following displayed in your browser and the LED should switch on

{"message": "Pin D7 set to 1", "id": "1", "name": "cc3000", "hardware": "arduino", "connected": true}

Now type in the following


{"message": "Pin D7 set to 0", "id": "1", "name": "cc3000", "hardware": "arduino", "connected": true}

You can repeat this for the other LEDs that you have connected to your CC3000 shield
  • Facebook
  • Twitter
  • Linkedin
  • Pinterest

Leave a Comment

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :