News

moodlite - Coming soon


Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Coolstuff55

Pages: 1
1
moodlite Software / Help to connect
« on: November 16, 2019, 03:33:40 AM »
Hi guys,
I've been trying for many weeks with no success. I have moved to V2 as many people have had more success. The first time it is run, I only see "ESP30xxxx" in my wifi list, but can connect to it with the password "Moodlite". The page then displays for me to input my Wifi details which I do. But it wont connect to my Wifi, and debug shows
Code: [Select]
Wifi status: 6
--- initWiFi - End ---
I have tried many static IP addresses and DHCP but no luck. Any help would be much appreciated.
Also, I have some experience in C programming and networking, so its not all totally new to me.
Cheers,
Matt

2
moodlite Software / Rhythm function and PCB update
« on: October 03, 2019, 11:27:54 AM »
Hi all,
I have received my PCBs back and are ready to assemble. I have attached some photos below.
I have also added a microphone circuit with a small amplifier connected to the analog pin of the ESP8266,
with the hope of adding a rhythm function later.
I have found a piece of code online called soundbracelet that looks great for this task.
A demo of the code can be seen here :
&feature=youtu.be

I have tried adding the code to a moodlite function, but my arduino coding is relatively limited.
Heres what I've got so far. Any help would be much appreciated. MIC_PIN etc is defined on the main page
Cheers,
Matt

Code: [Select]
void three_sin()  //just overwriting an exsisting function as a test
{
  #define DC_OFFSET  0                                         // DC offset in mic signal - if unusure, leave 0
                                                                // I calculated this value by serialprintln lots of mic values
  #define NOISE     30                                         // Noise/hum/interference in mic signal and increased value until it went quiet
  #define SAMPLES   60                                          // Length of buffer for dynamic level adjustment
  #define TOP (iNrOfLeds + 2)                                    // Allow dot to go slightly off scale
  #define PEAK_FALL 10                                          // Rate of peak falling dot
 
  byte
    peak      = 0,                                              // Used for falling dot
    dotCount  = 0,                                              // Frame counter for delaying dot-falling speed
    volCount  = 0;                                              // Frame counter for storing past volume data
  int
    vol[SAMPLES],                                               // Collection of prior volume samples
    lvl       = 10,                                             // Current "dampened" audio level
    minLvlAvg = 0,                                              // For dynamic adjustment of graph low & high
    maxLvlAvg = 512;


 
  uint8_t  i;
  uint16_t minLvl, maxLvl;
  int      n, height;
   
  n = analogRead(MIC_PIN);                                    // Raw reading from mic
  n = abs(n - 512 - DC_OFFSET);                               // Center on zero

  Serial.println(n);
 
  n = (n <= NOISE) ? 0 : (n - NOISE);                         // Remove noise/hum
  lvl = ((lvl * 7) + n) >> 3;                                 // "Dampened" reading (else looks twitchy)
 
  // Calculate bar height based on dynamic min/max levels (fixed point):
  height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg);
 
  if (height < 0L)       height = 0;                          // Clip output
  else if (height > TOP) height = TOP;
  if (height > peak)     peak   = height;                     // Keep 'peak' dot at top
 
 
  // Color pixels based on rainbow gradient
  for (int k=0; k<iNrOfLeds; k++) {
    if (k >= height)   crgbLeds[k].setRGB( 0, 0,0);
    else crgbLeds[k] = ColorFromPalette(crgbCurrentPalette, 255, 255);
  }
 
  // Draw peak dot 
  if (peak > 0 && peak <= iNrOfLeds-1) crgbLeds[peak] = CHSV(map(peak,0,iNrOfLeds-1,30,150), 255, 255);
 
  addEffect();

// Every few frames, make the peak pixel drop by 1:
 
    if (++dotCount >= PEAK_FALL) {                            // fall rate
      if(peak > 0) peak--;
      dotCount = 0;
    }
 
  vol[volCount] = n;                                          // Save sample for dynamic leveling
  if (++volCount >= SAMPLES) volCount = 0;                    // Advance/rollover sample counter
 
  // Get volume range of prior frames
  minLvl = maxLvl = vol[0];
  for (i=1; i<SAMPLES; i++) {
    if (vol[i] < minLvl)      minLvl = vol[i];
    else if (vol[i] > maxLvl) maxLvl = vol[i];
  }
  // minLvl and maxLvl indicate the volume range over prior frames, used
  // for vertically scaling the output graph (so it looks interesting
  // regardless of volume level).  If they're too close together though
  // (e.g. at very low volume levels) the graph becomes super coarse
  // and 'jumpy'...so keep some minimum distance between them (this
  // also lets the graph go to zero when no sound is playing):
  if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP;
  minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6;                 // Dampen min/max levels
  maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6;                 // (fake rolling average)

}


Pages: 1

SMF spam blocked by CleanTalk