]> git.piffa.net Git - sketchbook_andrea/blobdiff - libraries/common/common.h
PWM Pulse
[sketchbook_andrea] / libraries / common / common.h
index 7f87600b466749d4a3476037c691ce2df212fdeb..b74ab4528bc3d4b0a5bffc759170c464fe3a55f4 100644 (file)
@@ -48,12 +48,13 @@ class RGBLed {
     byte redValue ;
     byte greenValue ;
     byte blueValue ;
-    byte common ;
+    boolean common ;
 
   public:
     RGBLed (byte pinR, byte pinG, byte pinB) ;
     RGBLed (byte pinR, byte pinG, byte pinB, byte com) ;
        void SetColor (byte r, byte g, byte b) ;
+       void Rand ();
        void Red ();
     void Green ();
     void Blue ();
@@ -101,6 +102,8 @@ class Pwm {
     int speed ;            // velocita' del ciclo in ms
     unsigned long previousMillis ;  //precedente cambio di stato
     byte increment ;       // aumenta brighteness nel loop UD
+    int step;              // Pulse: stato del loop PWM
+    int interval ;         // Pulse: Intervallo tra step 
 
     // Constructor: come viene instanziato un oggetto facente parte della classe
 public:
@@ -110,6 +113,8 @@ public:
     void Down(long speed, long drift = 0);
     void lDown(long speed, long drift = 0);
     void UD(long speed, long drift = 0);
+    void Pulse(int interval, int pausa = 255);
+    void RandomPulse(int min = 1, int max = 10, int pausa = 255);
     void Set(byte brighteness);
     void lSet(byte brighteness);
     byte brightness  ;      // luminostia' iniziale
@@ -157,7 +162,7 @@ void brilla(byte pin, int velocita = 200) ;
 
 byte lum(byte val);
 
-int calibraTrim(int pin, byte ledPin = 13);
+int calibraTrim(int pin, const byte ledPin = 13);
 
 
 #endif