Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Adafruit Motor / Stepper / Servo Shield para Arduino Kit v2
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit Motor / Stepper / Servo Shield para Arduino Kit v2

by Ingeniero_Tijuana on Tue Mar 18, 2014 7:32 pm

Buenas tardes foro, soy un estudiante de ingenieria en sistemas computacionales, y me gustaria saber si pueden ayudarme con el codigo de arduino para hacer que se mueva el M1 y M2 a la vez, soy nuevo en esto del arduino y en el Adafruit Motor / Stepper / Servo Shield para Arduino Kit v2 - v2.0 ya hice la prueba que esta en el arduino, y tambien al cargar el ejemplo de DC Motor test, espero su ayuda companeros gracias
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by adafruit_support_bill on Wed Mar 19, 2014 6:20 am

[via Google Translate]
Good forum evening, I'm a student of engineering in computer systems, and I would like to know if you can help me with the code of arduino to make it move the M1 and M2 at the same time, I am new to the Arduino and the Adafruit Motor / Stepper / Servo Shield for Arduino Kit v2 - v2.0 and I tested this on the arduino, and also to load the example of DC Motor test, I hope your comrades help thanks


To run 2 motors, you must define two motors in your program:
Code: Select all | TOGGLE FULL SIZE
// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *Motor1 = AFMS.getMotor(1);
// You can also make another motor on port M2
Adafruit_DCMotor *Motor2= AFMS.getMotor(2);


You can set the speed and direction for each motor like this:
Code: Select all | TOGGLE FULL SIZE
  // Set the speed to start, from 0 (off) to 255 (max speed)
  Motor1->setSpeed(150); 
  Motor2->setSpeed(150);

  Motor1->run(FORWARD);
  Motor2->run(FORWARD);

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Fri Mar 21, 2014 2:34 am

Buenas noches muchas gracias eso me sirvio de mucho de echo ya habia investigado referente a eso, ahora el problema que tengo es que me gustaria usando un pushbutton mover el motor, me refiero que al presionarlo el motor avance, otra duda es que los dos motores avancen usando un solo pushbutton, lo que pasa es que tengo un proyecto en el cual tengo que mover un motor con un boton por medio de wifi de echo tambien tengo ya el Adafruit Wifi Shield CC30000 v1, pero ahorita me gustaria hacerlo usando el pushbutton tanto para un motor como para dos, espero me ayuden, se los agradeceria mucho, gracias

[Google Translate]
Good night, thank you very much that served me well in fact had already researched regarding that, now the problem I have is that I like using a pushbutton to move the motor, I mean that when pressed the advance engine, another doubt is that the two engines advance using a single pushbutton, what happens is that I have a project where I have to move a motor with a button through wifi echo also I have already Adafruit Wifi Shield CC30000 v1, but I right now would like to do this using the pushbutton both as an engine for two, I hope to help me, they are much appreciate thanks
Last edited by adafruit_support_bill on Fri Mar 21, 2014 6:56 am, edited 1 time in total.
Reason: Added translation
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Fri Mar 21, 2014 3:20 am

una duda mas como puedo hacer para que al presionar el boton avance cuando este presionado, por que en esta parte del codigo avanza por un tiempo nada mas
[Google Translate]
doubt more as I make progress by pressing the button when pressed, that in this part of the code proceeds in a while nothing else


myMotor->run(FORWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
delay(10);

en cambio si hago esto solo avanza y de para, avanza y se para, lo que necesito que al presionar el boton sea continuo y al dejar de presionar pare
[Google Translate]
however if I do this and just moves to, and advances to, I need to press the button that is continuous and stop pressing stop


myMotor->run(FORWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
Last edited by adafruit_support_bill on Fri Mar 21, 2014 6:57 am, edited 1 time in total.
Reason: Added translation
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by adafruit_support_bill on Fri Mar 21, 2014 7:00 am

The code you posted does not show how you are reading the buttons. Please post the complete code that you are using, and a diagram showing how your buttons are connected to the Arduino.

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Sat Mar 22, 2014 1:21 am

aqui esta mi codigo completo

Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
Adafruit_DCMotor *myMotor1 = AFMS.getMotor(2);
const int buttonPin = 2;
int buttonState = 0;

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");
  pinMode(buttonPin, INPUT) ;
  AFMS.begin();  // create with the default frequency 1.6KHz
  myMotor->setSpeed(150);
  myMotor1->setSpeed(150);
  myMotor->run(FORWARD);
  myMotor1->run(FORWARD);
  // turn on motor
  myMotor->run(RELEASE);
}

void loop() {
  uint8_t i;
 
buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH)
  {     
  myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i); 
 
  }

  myMotor->run(RELEASE);
  delay(1000);
  }
}
Last edited by adafruit_support_bill on Sat Mar 22, 2014 7:19 am, edited 1 time in total.
Reason: Please use the 'code' button when submitting code - click 'code' and paste your code between the tags.
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Sat Mar 22, 2014 2:57 am

tomando en cuenta que el shield esta arriba de el arduino y el motor esta conectado en M1
Attachments
boton.png
asi es como esta conectado
boton.png (305.11 KiB) Viewed 816 times
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by adafruit_support_bill on Sat Mar 22, 2014 7:25 am

I think the loop that you want is like this:

Code: Select all | TOGGLE FULL SIZE
void loop()
{
  uint8_t i;
 
  buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH)
  {     
     myMotor->run(FORWARD);
  }
  else
  {
     myMotor->run(RELEASE);
  }
}

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Tue Apr 08, 2014 10:06 pm

hola buenas tardes me gustaria que me ayudaran a optimizarmi codigo aparte no se si este bien estructurado, por que al activar el boton de avance un motor enciende antes que el otro despues avanzan juntos, que debo hacer para que avance al mismo tiempo que presiono el boton este es mi codigo se los agradeceria mucho

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
Adafruit_DCMotor *myMotor1 = AFMS.getMotor(2);
const int buttonPin = 2;
int buttonState = 0;
const int buttonPin1 = 3;
int buttonState1 = 0;

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Adafruit Motorshield v2 - DC Motor test!");
pinMode(buttonPin, INPUT) ;
AFMS.begin(); // create with the default frequency 1.6KHz
myMotor->setSpeed(150);
myMotor1->setSpeed(150);
myMotor->run(FORWARD);
myMotor1->run(FORWARD);
// turn on motor
myMotor->run(RELEASE);
myMotor1->run(RELEASE);
}

void loop() {
uint8_t i;

buttonState = digitalRead(buttonPin);
buttonState1 = digitalRead(buttonPin1);

if (buttonState == HIGH)
{
myMotor->run(FORWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
}
myMotor1->run(FORWARD);
for (i=0; i<255; i++) {
myMotor1->setSpeed(i);
}
}
else
{
myMotor->run(RELEASE);
myMotor1->run(RELEASE);
}

if (buttonState1 == HIGH)
{
myMotor->run(BACKWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
}
}
else
{
myMotor->run(RELEASE);
}
}
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Tue Apr 22, 2014 1:04 am

buenas noches me gustaria saber que paso no me han contestado lo anterior, otra pregunta mas espero y me puedan ayudar necesito mover los motores desde una pagina web u voy a usar el wifi shield v1 cc3000, espero y me puedan ayudar se los agradeceria mucho
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by adafruit_support_bill on Tue Apr 22, 2014 7:22 am

(via Google Translate)
hello good afternoon I would like to help me optimizarmi apart if this code is not well structured, that when activating the button lights feed an engine before the other after moving together, which I make progress while I press the Pin this is my code would greatly appreciate is the

I do not understand the question. The translation is not very clear. What i is the problem you are having with this code?

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Wed Apr 23, 2014 11:00 pm

ok disculpa mi traduccion, pero te escribo desde mexico y no se escribir en ingles. mi proyecto es hacer mover un robot por medio de una pagina web, quisiera saber si me puedes ayudar con un ejemplo o alguna orientacion de como hacerlo, otro problema que tengo es que en mi codigo se tienen que mover dos motores al mismo tiempo, pero se mueve primero uno y despues el otro, a lo que me refiero es que hay un atraso en un robot este es mi codigo que tengo hasta ahorita.

Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
Adafruit_DCMotor *myMotor1 = AFMS.getMotor(2);
const int buttonPin = 2;
int buttonState = 0;
const int buttonPin1 = 3;
int buttonState1 = 0;
const int buttonPin2 = 4;
int buttonState2 = 0;
const int buttonPin3 = 5;
int buttonState3 = 0;

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");
  pinMode(buttonPin, INPUT) ;
  AFMS.begin();  // create with the default frequency 1.6KHz
  myMotor->setSpeed(150);
  myMotor1->setSpeed(150);
  myMotor->run(FORWARD);
  myMotor1->run(FORWARD);
  // turn on motor
  myMotor->run(RELEASE);
  myMotor1->run(RELEASE);
}

void loop() {
  uint8_t i;
 
  buttonState = digitalRead(buttonPin);
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);


//boton para avanzar
  if (buttonState == HIGH)
  {     
     myMotor->run(FORWARD);
     for (i=0; i<255; i++) {
     myMotor->setSpeed(i);
  }
     myMotor1->run(FORWARD);
     for (i=0; i<255; i++) {
     myMotor1->setSpeed(i);
  }
  }
  else
  {
     myMotor->run(RELEASE);
     myMotor1->run(RELEASE);
  }
 
 
  //boton para atras
  if (buttonState1 == HIGH)
  {     
     myMotor->run(BACKWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);
  }
   myMotor1->run(BACKWARD);
  for (i=0; i<255; i++) {
    myMotor1->setSpeed(i);
  }
  }
  else
  {
    myMotor->run(RELEASE);
    myMotor1->run(RELEASE);
  }
 
 
  //boton para dar vuelta a la derecha
   if (buttonState2 == HIGH)
  {     
     myMotor->run(FORWARD);
     for (i=0; i<255; i++) {
    myMotor->setSpeed(i);
  }
  }
 else
  {
   myMotor->run(RELEASE);
    myMotor1->run(RELEASE);
  }
 
 
 
  //boton para dar vuelta a la izquierda
   if (buttonState3 == HIGH)
  {     
     myMotor1->run(FORWARD);
     for (i=0; i<255; i++) {
    myMotor1->setSpeed(i);
  }
  }
 else
  {
    myMotor->run(RELEASE);
    myMotor1->run(RELEASE);
  }
}


necesito saber si mi codigo esta mal estructurado,te agradeceria tu ayuda
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by adafruit_support_bill on Thu Apr 24, 2014 6:20 pm

ok excuse my translations, but I write from mexico and do not write in English. my project is to move a robot through a web page, I wonder if you can help me with an example or some guidance on how to do so

This tutorial should help: https://learn.adafruit.com/wifi-control ... troduction

, another problem I have is that you have to move two motors at the same time in my code, but moves first one and then the other, what I mean is that there is a delay in a robot this is my code that I have so far.

I need to know if my code is poorly structured, I appreciate your help


The reason the motors move separately is because you have them in separate loops. like this:
Code: Select all | TOGGLE FULL SIZE
  if (buttonState == HIGH)
  {     
     myMotor->run(FORWARD);
     for (i=0; i<255; i++) {
     myMotor->setSpeed(i);
  }
     myMotor1->run(FORWARD);
     for (i=0; i<255; i++) {
     myMotor1->setSpeed(i);
  }

If you want them to move together, you have to put them in the same loop like this:
Code: Select all | TOGGLE FULL SIZE
  if (buttonState == HIGH)
  {     
     myMotor->run(FORWARD);
     myMotor1->run(FORWARD);
     for (i=0; i<255; i++)
     {
        myMotor->setSpeed(i);
        myMotor1->setSpeed(i);
     }
  }

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Tue May 06, 2014 1:18 am

buenas noches, me gustaria saber si pueden ayudame, mi problema es que ningun ejemplo de la libreria adafruit_cc3000, y no me lo reconoce, no se si puedan ayudarme con eso me urge, se los agradeceria mucho
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Re: Adafruit Motor / Stepper / Servo Shield para Arduino Kit

by Ingeniero_Tijuana on Sat May 10, 2014 2:34 am

good evening, I'm trying to do a test with wifi shield v1 CC3000 and scribbles me out instead of relsutado should give as https://learn.adafruit.com/adafruit-cc3 ... /buildtest, which I would like is the error in the code is greatly appreciate, I hope your answer

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>
#include <string.h>
#include "utility/debug.h"

// These are the interrupt and control pins
#define ADAFRUIT_CC3000_IRQ   3  // MUST be an interrupt pin!
// These can be any two pins
#define ADAFRUIT_CC3000_VBAT  5
#define ADAFRUIT_CC3000_CS    10
// Use hardware SPI for the remaining pins
// On an UNO, SCK = 13, MISO = 12, and MOSI = 11
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,
                                         SPI_CLOCK_DIVIDER); // you can change this clock speed but DI

#define WLAN_SSID       "INFINITUMD5CBB4"        // cannot be longer than 32 characters!
#define WLAN_PASS       "71E27CEEC611"
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
#define WLAN_SECURITY   WLAN_SEC_WPA2



/**************************************************************************/
/*!
    @brief  Sets up the HW and the CC3000 module (called automatically
            on startup)
*/
/**************************************************************************/
void setup(void)
{
  Serial.begin(115200);
  Serial.println(F("Hello, CC3000!\n"));

  displayDriverMode();
  Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC);
 
  /* Initialise the module */
  Serial.println(F("\nInitialising the CC3000 ..."));
  if (!cc3000.begin())
  {
    Serial.println(F("Unable to initialise the CC3000! Check your wiring?"));
    while(1);
  }

  /* Optional: Update the Mac Address to a known value */
/*
  uint8_t macAddress[6] = { 0x08, 0x00, 0x28, 0x01, 0x79, 0xB7 };
   if (!cc3000.setMacAddress(macAddress))
   {
     Serial.println(F("Failed trying to update the MAC address"));
     while(1);
   }
*/
 
  uint16_t firmware = checkFirmwareVersion();
  if (firmware < 0x113) {
    Serial.println(F("Wrong firmware version!"));
    for(;;);
  }
 
  displayMACAddress();
 
  /* Optional: Get the SSID list (not available in 'tiny' mode) */
#ifndef CC3000_TINY_DRIVER
  listSSIDResults();
#endif
 
  /* Delete any old connection data on the module */
  Serial.println(F("\nDeleting old connection profiles"));
  if (!cc3000.deleteProfiles()) {
    Serial.println(F("Failed!"));
    while(1);
  }

  /* Attempt to connect to an access point */
  char *ssid = WLAN_SSID;             /* Max 32 chars */
  Serial.print(F("\nAttempting to connect to ")); Serial.println(ssid);
 
  /* NOTE: Secure connections are not available in 'Tiny' mode! */
  if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {
    Serial.println(F("Failed!"));
    while(1);
  }
   
  Serial.println(F("Connected!"));
 
  /* Wait for DHCP to complete */
  Serial.println(F("Request DHCP"));
  while (!cc3000.checkDHCP())
  {
    delay(100); // ToDo: Insert a DHCP timeout!
  } 

  /* Display the IP address DNS, Gateway, etc. */ 
  while (! displayConnectionDetails()) {
    delay(1000);
  }
 
#ifndef CC3000_TINY_DRIVER
  /* Try looking up http://www.adafruit.com */
  uint32_t ip = 0;
  Serial.print(F("www.adafruit.com -> "));
  while  (ip  ==  0)  {
    if  (!  cc3000.getHostByName("www.adafruit.com", &ip))  {
      Serial.println(F("Couldn't resolve!"));
    }
    delay(500);
  } 
  cc3000.printIPdotsRev(ip);
 
  /* Do a quick ping test on adafruit.com */ 
  Serial.print(F("\n\rPinging ")); cc3000.printIPdotsRev(ip); Serial.print("..."); 
  uint8_t replies = cc3000.ping(ip, 5);
  Serial.print(replies); Serial.println(F(" replies"));
  if (replies)
    Serial.println(F("Ping successful!"));
#endif

  /* You need to make sure to clean up after yourself or the CC3000 can freak out */
  /* the next time you try to connect ... */
  Serial.println(F("\n\nClosing the connection"));
  cc3000.disconnect();
}

void loop(void)
{
  delay(1000);
}

/**************************************************************************/
/*!
    @brief  Displays the driver mode (tiny of normal), and the buffer
            size if tiny mode is not being used

    @note   The buffer size and driver mode are defined in cc3000_common.h
*/
/**************************************************************************/
void displayDriverMode(void)
{
  #ifdef CC3000_TINY_DRIVER
    Serial.println(F("CC3000 is configure in 'Tiny' mode"));
  #else
    Serial.print(F("RX Buffer : "));
    Serial.print(CC3000_RX_BUFFER_SIZE);
    Serial.println(F(" bytes"));
    Serial.print(F("TX Buffer : "));
    Serial.print(CC3000_TX_BUFFER_SIZE);
    Serial.println(F(" bytes"));
  #endif
}

/**************************************************************************/
/*!
    @brief  Tries to read the CC3000's internal firmware patch ID
*/
/**************************************************************************/
uint16_t checkFirmwareVersion(void)
{
  uint8_t major, minor;
  uint16_t version;
 
#ifndef CC3000_TINY_DRIVER 
  if(!cc3000.getFirmwareVersion(&major, &minor))
  {
    Serial.println(F("Unable to retrieve the firmware version!\r\n"));
    version = 0;
  }
  else
  {
    Serial.print(F("Firmware V. : "));
    Serial.print(major); Serial.print(F(".")); Serial.println(minor);
    version = major; version <<= 8; version |= minor;
  }
#endif
  return version;
}

/**************************************************************************/
/*!
    @brief  Tries to read the 6-byte MAC address of the CC3000 module
*/
/**************************************************************************/
void displayMACAddress(void)
{
  uint8_t macAddress[6];
 
  if(!cc3000.getMacAddress(macAddress))
  {
    Serial.println(F("Unable to retrieve MAC Address!\r\n"));
  }
  else
  {
    Serial.print(F("MAC Address : "));
    cc3000.printHex((byte*)&macAddress, 6);
  }
}


/**************************************************************************/
/*!
    @brief  Tries to read the IP address and other connection details
*/
/**************************************************************************/
bool displayConnectionDetails(void)
{
  uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;
 
  if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))
  {
    Serial.println(F("Unable to retrieve the IP Address!\r\n"));
    return false;
  }
  else
  {
    Serial.print(F("\nIP Addr: ")); cc3000.printIPdotsRev(ipAddress);
    Serial.print(F("\nNetmask: ")); cc3000.printIPdotsRev(netmask);
    Serial.print(F("\nGateway: ")); cc3000.printIPdotsRev(gateway);
    Serial.print(F("\nDHCPsrv: ")); cc3000.printIPdotsRev(dhcpserv);
    Serial.print(F("\nDNSserv: ")); cc3000.printIPdotsRev(dnsserv);
    Serial.println();
    return true;
  }
}

/**************************************************************************/
/*!
    @brief  Begins an SSID scan and prints out all the visible networks
*/
/**************************************************************************/

void listSSIDResults(void)
{
  uint8_t valid, rssi, sec, index;
  char ssidname[33];

  index = cc3000.startSSIDscan();

  Serial.print(F("Networks found: ")); Serial.println(index);
  Serial.println(F("================================================"));

  while (index) {
    index--;

    valid = cc3000.getNextSSID(&rssi, &sec, ssidname);
   
    Serial.print(F("SSID Name    : ")); Serial.print(ssidname);
    Serial.println();
    Serial.print(F("RSSI         : "));
    Serial.println(rssi);
    Serial.print(F("Security Mode: "));
    Serial.println(sec);
    Serial.println();
  }
  Serial.println(F("================================================"));

  cc3000.stopSSIDscan();
Attachments
CPATURA DE RESULTADO.PNG
CPATURA DE RESULTADO.PNG (14.99 KiB) Viewed 671 times
SALIDA DE MONITOR.PNG
this is my result in the serial monitor
SALIDA DE MONITOR.PNG (37.86 KiB) Viewed 671 times
Last edited by adafruit_support_bill on Sat May 10, 2014 12:59 pm, edited 1 time in total.
Reason: please use the code button when submitting code. press [Code], then paste your code between the [code] [/code] tags.
Ingeniero_Tijuana
 
Posts: 14
Joined: Tue Mar 18, 2014 7:21 pm

Please be positive and constructive with your questions and comments.