Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By tj4shee
#36005 Hey Everyone !

I have an odd problem ... most likely something goofy I am missing....

I have an ESP-01 with 1M.... I am able to flash it (with Arduino of course) fine... and directly after my code is flashed to it, it starts running without problem.

If I cut power to the ESP-01, the code does not run when power is re-applied......

Here is the code...... like I said... this runs fine directly after flashing it... but then acts like it was never loaded

Code: Select all#include <NeoPixelBus.h>

#define pixelCount 10
NeoPixelBus strip = NeoPixelBus(pixelCount, 2);

uint8_t rainbow[142];
float brightness = 0.5;

void setup()
{
  pinMode(2, OUTPUT);
  strip.Begin();
  strip.Show();
  createRainbow();
}

void loop()
{
   int pos = 0;
   while (pos < 141)
   {
      for (int i = pixelCount - 1; i > 0; i--)
      {
         strip.SetPixelColor(i, strip.GetPixelColor(i - 1));
      }
       strip.SetPixelColor(0, RgbColor(rainbow[pos] * brightness, rainbow[pos + 1] * brightness, rainbow[pos + 2] * brightness));
       strip.Show();
       pos += 3;
       delay(50);
   }
}

void createRainbow()
{
   uint8_t redValue = 128;
   uint8_t greenValue = 16;
   uint8_t blueValue = 16;
   int step = 1;
   int pos = 0;
   while (step < 7)
   {
      rainbow[pos] = redValue;
      rainbow[pos + 1] = greenValue;
      rainbow[pos + 2] = blueValue;
      pos += 3;
      switch (step)
      {
         case 1:
            if (blueValue < 112) blueValue += 16;
            else { blueValue = 128; step++; }
            break;
         case 2:
            if (redValue > 0) redValue -= 16;
            else { redValue = 16; step++; }
            break;
         case 3:
            if (greenValue < 112) greenValue += 16;
            else { greenValue = 128; step++; }
            break;
         case 4:
            if (blueValue > 0) blueValue -= 16;
            else { blueValue = 16; step++; }
            break;
         case 5:
            if (redValue < 112) redValue += 16;
            else { redValue = 128; step++; }
            break;
         case 6:
            if (greenValue > 0) greenValue -= 16;
            else step++;
            break;
      }
   }
}
User avatar
By tj4shee
#36015
martinayotte wrote:Did you disconnect the GPIO0 after flashing ? Does it have a pullup resistor to VCC ?


It did... and Thank You so much for answering....

It turned out to be a loose wire..... the odd thing is I flashed it several times.... and it would work.. until I powered it off... just a coincidence I guess.....

But after playing around with it too much... lo and behold... a wire came completely undone..... dang stranded wires :D