Member #333894

Member Since: June 26, 2012

Country: United States

  • Product SEN-11195 | about 3 weeks ago

    // Copyleft Zach Vorhies 2014
    // No rights reserved.
    // Tested on an ArduinoMega. Connect pins to RX and TX.
    // Usage:
    //  ColorDetector<HardwareSerial> cd(Serial3);
    //  void setup() { cd.begin(); }
    //  void loop() {
    //    if (cd.Update()) {  // True when new readings have occured.
    //      cd.PrintValues(Serial);  // print values.
    //    }
    //  }
    
    
    template<class StreamT>  // StreamT == HardwareSerial or SoftSerial.
    class ColorDetector {
     public:
      ColorDetector(StreamT& s)
         : input_(""), stream_(s),
           r(0), b(b), g(0),
           r_lx(0), b_lx(0), g_lx(0), total_lx(0),
           saturated(false) {
        input_.reserve(kStrLen);  // Upto 36 characters for the rgb+lx data.     
      }
    
      void begin() {
        stream_.begin(38400);
        stream_.write("M3\r");  // Sets mode0 of the sensor.
      }
    
      // Returns true if new values were parsed.
      bool Update() {
        while (stream_.available() > 0) {
          //if the hardware serial port_3 receives a char 
          //get the char we just received
          char inchar = (char)stream_.read();
          //add it to the inputString
          input_ += inchar; 
          if(inchar == '\r') {
            saturated = input_.indexOf('*') != -1;
    
    
            // Time to parse out the string into values.
            int* values[] = {&r, &g, &b, &r_lx, &g_lx, &b_lx, &total_lx};
            const int values_size = sizeof(values)/sizeof(values[0]);
            int i = 0;
    
            char cpy_str[kStrLen];
            input_.toCharArray(cpy_str, kStrLen);
            input_ = "";  // resets the input.
    
            char* p = cpy_str;
    
            char *str;
             // delimiter is the comma
            while (i < values_size && (str = strtok_r(p, ",", &p)) != NULL) {
              String cpy = str;
              *values[i] = cpy.toInt();
              ++i;
            }
            return true;
          }
          // No update yet.
          return false;
        }
      }
    
      void PrintValues(Stream& output) {
        int* values[] = {&r, &b, &g, &r_lx, &b_lx, &g_lx, &total_lx};
        const int array_size = sizeof(values) / sizeof(values[0]);
        for (int i = 0; i < array_size; ++i) {
          output.print(*values[i]);
          if (i < array_size - 1) {
            output.print(",");
          }
        }
        if (saturated) {
          output.print(",<saturated>");
        }
        output.println();
      }
    
      int r, b, g;
      int r_lx, b_lx, g_lx, total_lx;
      bool saturated;
    
     private:
      static const int kStrLen = 38;
      String input_;
      StreamT& stream_;
    };
    
    
    ColorDetector<HardwareSerial> color_detector(Serial3);
    
    void setup() 
      Serial.begin(9600);
      color_detector.begin();
    }
    
    void loop() {
      if (color_detector.Update()) {
        color_detector.PrintValues(Serial);
      }
    }
    
  • Product BOB-09868 | last month

    This mic is very heat sensitive! You can easily kill it with a heat gun!!

    I was making some voice-reactive jewelry with this little mic. My jewelry uses U-mold plastic; I use a heat gun to mold the plastic and add layers to the jewelry. Heating the plastic to make it playable resulted in the mems mic board not working. I did this twice before realizing what was happening. Please be aware!!!

  • Product DEV-11190 | last month

    Does anyone know the charge rate on for the on-board MCP73831?

  • Product SEN-12055 | about 2 months ago

    Reading the data sheet it appears that this sensor has a illuminance response rate of 400ms, is that right?

  • Product DEV-11190 | about 2 months ago

    I had the same problem even with the Adafruit Mic Amp. However I was able to solve the problem on the Adafruit Mic by putting 4.7uf decoupling capacitor on the batteries terminals.

  • Product DEV-11190 | about 2 months ago

    I’m having an issue with this board with relation to noisy electret mic (op-amp) readings? and wondering if anyone else is experiencing this and knows what a solution is.

    I attach the mic to any of the analog inputs in the Lilypad Arduino USB. I get almost near constant 1024 readings f it. Funny thing, it does this also with a brand new arduino lilypad as well.

  • Product COM-00530 | about 8 months ago

    The downside to these lights is that they push all of their light in a 20 degree band. They are also not as efficient as the top-notch stuff on the internet.

    For these lights here the data sheet says 10,000 mcd at a 20 deg viewing angle. Calculating the total light output of 0.95 lumens.

    However, we found these automotive ones that have 2100 - 3100 mcd at a 120 degree viewing angle, which is ~8 lumens.

    So if you want a wider angle or want to pump light into a fibre optic cable then I suggest checking out http://www.kingbrightusa.com/product.asp?catalog_name=LED&product_id=AA3528SES/J4

    Just as a disclaimer, I don’t have any vested interest in the above company. I just need really bright lights :)

  • Product DEV-11285 | about a year ago

    Same thing happened to me. The casing just popped off and the joints don’t take rosen core solder very well, at least when I tried it.

No public wish lists :(