Member #472537

Member Since: September 24, 2013

Country: United States

  • Product LCD-00709 | about 3 months ago

    LCD works for 2 minutes and then the screen dims…… wired as instructed in the SIK guide. Any ideas?

  • News - SparkFun Live! - Random P… | about 3 months ago

    LOL pretty cool. I know there is feverish excitement over the Broncos in the Superbowl, will this be ready to put in use for post celebrations…. looks like a day late….

  • Tutorial - MPR121 Hookup Guide | about 3 months ago

    Ok, so I am using the CC3300, and my difficulty is getting the data from MPR121 loop to feed into the Xively, I have broken up each of the sensors into Case instances, similar to the Bildr tutorial, I am posting the code below. (if that helps) much appreciated.

    /*Copyright © 2010 bildr community

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //

    include <Adafruit_CC3000.h>

    include <ccspi.h>

    include <SPI.h>

    include <string.h>

    include “utility/debug.h”

    include <stdlib.h>

    include “mpr121.h”

    include <Wire.h>

    define ADAFRUIT_CC3000_IRQ 3

    define ADAFRUIT_CC3000_VBAT 5

    define ADAFRUIT_CC3000_CS 10

    Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIV2);

    define WLAN_SSID “” // cannot be longer than 32 characters!

    define WLAN_PASS “”

    // Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2

    define WLAN_SECURITY WLAN_SEC_WPA2

    define WEBSITE “api.xively.com”

    define API_key “”

    define feedID “”

    //Somewhere in here I need to create an instance to register the mpr121? //possibly could be in the wrong order //have not been able to get the mpr121 to register to the internet yet, I have tried a couple different formats //I have both the Imp April and CC3300 break out //

    Serial.println(F(“\nInitializing…”)); if (!cc3000.begin()) { Serial.println(F(“Couldn’t begin()! Check your wiring?”)); while(1); } int irqpin = 2; // Digital 2 boolean touchStates[12]; //to keep track of the previous touch states

    void setup(){ pinMode(irqpin, INPUT); digitalWrite(irqpin, HIGH); //enable pullup resistor

    Serial.begin(115200); Wire.begin();

    mpr121_setup(); }

    void loop(){ readTouchInputs(); }

    void readTouchInputs(){ if(!checkInterrupt()){

    //read the touch state from the MPR121
    Wire.requestFrom(0x5A,2); 
    
    byte LSB = Wire.read();
    byte MSB = Wire.read();
    
    uint16_t touched = ((MSB << 8) | LSB); //16bits that make up the touch states
    
    
    for (int i=0; i < 12; i++){  // Check what electrodes were pressed
      if(touched & (1<<i)){
    
        if(touchStates[i] == 0){
          //pin i was just touched
          Serial.print("Pin ");
          Serial.print(i);
          Serial.println(" was just touched");
    
          switch (i) {
            case 0:
             // 0 was just touched
             Serial.print("");
             Serial.print("");
             break;
             case 1:
             // 1 was touched
             Serial.print("Did you Wash your Hands! GROSS"); 
             break;
             case 2:
             // 2 was touched
             Serial.print(""); 
             Serial.print("");
             break;
             case 3:
             // 3 was touched
             Serial.print(" ");
             Serial.print(" ");
             break; 
             case 4:
             // 4 was touched 
             Serial.print(" ");
             Serial.print(" ");
             break;
             case 5:
             // 5 was just touched
             Serial.print(" ");
             break;
             case 6: 
             // 6 was just touched
             Serial.print(" ");
             break;
             case 7:
             // 7 was just touched
             Serial.print(" ");
             break;
             case 8:
             // 8 was just touched
             Serial.print(" ");
             break;
             case 9:
             // 9 was pressed 
             Serial.print(" ");
             break;
             case 10:
             // 10 was just pressed 
             Serial.print(" ");
             break;
             case 11:
             // 11 was just touched
             Serial.print(" "); 
    
    
          }           
    
        }else if(touchStates[i] == 1){
          //pin i is still being touched
        }  
    
        touchStates[i] = 1;      
      }else{
        if(touchStates[i] == 1){
          Serial.print(" pin ");
          Serial.print(i);
          Serial.println(" Shelf is no longer being touched");
    
          //pin i is no longer being touched
       }
    
        touchStates[i] = 0;
      }
    
    }
    

    } }

    void mpr121_setup(void){

    set_register(0x5A, ELE_CFG, 0x00);

  • Tutorial - MPR121 Hookup Guide | about 3 months ago

    Looking at using the WiFly or something similar. Like the CC3300. Either way I am stuck on register a touch being pushed to Xively and shield picking up the touches, not the mpr121 yet the wifi module itself. If that clarifies. Thanks again….

  • Tutorial - MPR121 Hookup Guide | about 3 months ago

    Both actually. Looking over my previous reply that is a little confusing.

  • Tutorial - MPR121 Hookup Guide | about 3 months ago

    Ok I’ve tried a couple different ways to extract the data, I think I get caught up in all the code for the mpr, so this is where I am at, I am trying to send data to Xively, I have done all that, and wifi shield cooperates. I am struggling with creating the appropriate sensor instance, after which I understand I must convert these instances into integers that Xively can read, through JSON, my problem is defining that instance, and relating that to the integers of 1 and 0, would I refer it touchStates [i] and does it matter that I have each sensor printing out different information…. Or do I define an instance for each sensor, and transfer that data into a JSON string? (that would be a lot of data) Thanks, I will send you a case a beer……. :)

  • Tutorial - MPR121 Hookup Guide | about 4 months ago

    Awesome thanks!

  • Tutorial - MPR121 Hookup Guide | about 4 months ago

    When wiring the mpr121 to the electric imp the response time was a little two slow for my application, it need it to read the touch inputs in real time so I have switched to a different wireless solution. My question is I want to send the touch data to Xively to keep track of the touch states, I understand that the data has to be turned into a string to be read by the API, there plenty of tutorials using temp sensors, etc, how does one transfer touch states into a json data string to be read by Xively? Any help would be grateful.

  • Product SEN-09695 | about 4 months ago

    Put the plastic pad on first, and then fire up the MPR121 and see what happens. I had the same problem with a different set up and that fixed it.

  • Tutorial - MPR121 Hookup Guide | about 4 months ago

    Thanks!

    Any idea about connecting an imp to one of these. More concerned about the pin layout to create a connection. Thanks for the prompt response.

No public wish lists :(