Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
X

xsav

@xsav
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • TimerOne.h LED Effekt
    X xsav

    Hello,
    I am an Arduino beginner and have tried to do it by myself. Unfortunately it does not work.
    I would like my Demo LED effect to turn on after 3 minutes, but it does not turn on. Therefore I am looking for some help. Could anybody please help me and say where the error is in my sketch.

    #include <Adafruit_NeoPixel.h>
    #include <TimerOne.h>
    
    #define PINR 6         
    
    int led_ring = 60;   //  Leds (Ring)
    
    Adafruit_NeoPixel ring = Adafruit_NeoPixel(led_ring, PINR, NEO_GRB + NEO_KHZ800);
    boolean Demo = false;
    int command = 0 ;     
    uint32_t c;
    int all_x_minut=3;   // 
    
    void setup() 
    {
      ring.begin();
      ring.show();    
      ring.setBrightness(75);
      Serial.begin(9600);
      
      Timer1.initialize(all_x_minut*60000);
      Timer1.attachInterrupt(Demostart);
    }  
    
    // ************** Programm ********************
    
    void loop() 
    {
      if (Serial.available() > 0) 
      {   
        Timer1.initialize(all_x_minut*60000);
        Demo == true;
        command = Serial.read();
         {
        } 
      }   
      
      if (Demo == true)
      {
        Demomodus();
      }  
    }
    
    // *************** Funktionen ********************
    
    void rainbowCycle(uint8_t wait)        
    {
      uint16_t i, j;
      for(j=0; j<256*1; j++) { // 5 cycles of all colors on wheel
        for(i=0; i< ring.numPixels(); i++) 
        {
          ring.setPixelColor(i, Wheel(((i * 256 / ring.numPixels()) + j) & 255));
        }
        ring.show();
        delay(wait);
      }
    }
    
    uint32_t Wheel(byte WheelPos) 
    {
      WheelPos = 255 - WheelPos;
      if(WheelPos < 85) 
      {
        return ring.Color(255 - WheelPos * 3, 0, WheelPos * 3);
      }
      if(WheelPos < 170) 
      {
        WheelPos -= 85;
        return ring.Color(0, WheelPos * 3, 255 - WheelPos * 3);
      }
      WheelPos -= 170;
      return ring.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
    }
    
    void Demomodus() 
    {
     rainbowCycle(55);
    }  
    
    void Demostart() 
    {
      Demo == true;
    }
    

    Thank you in advance and kind regards!

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular