Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions PiGlow/PiGlow.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define _PIGLOW_H

#define PIGLOW_RING_RED 0
#define PIGLOW_RING_YELLOW 1
#define PIGLOW_RING_ORANGE 2
#define PIGLOW_RING_ORANGE 1
#define PIGLOW_RING_YELLOW 2
#define PIGLOW_RING_GREEN 3
#define PIGLOW_RING_BLUE 4
#define PIGLOW_RING_WHITE 5
Expand All @@ -13,9 +13,9 @@ class PiGlow
{
public:
PiGlow(){
leg0 = { 6, 7, 8, 5, 4, 9 } ;
leg1 = { 17, 16, 15, 13, 11, 10 } ;
leg2 = { 0, 1, 2, 3, 14, 12 } ;
int leg0[6] ;
int leg1[6] ;
int leg2[6] ;
}
void setup(const int b);
void write (int pin, int value);
Expand All @@ -27,7 +27,10 @@ PiGlow(){
void setBrightness ( const int b );
void reset();
private:
int leg0[6],leg1[6],leg2[6],brightness;
int leg0[6] = { 6, 7, 8, 5, 4, 9 } ;
int leg1[6] = { 17, 16, 15, 13, 11, 10 } ;
int leg2[6] = { 0, 1, 2, 3, 14, 12 } ;
int brightness;
void piGlowCmd( int reg, int data );
};

Expand Down
4 changes: 2 additions & 2 deletions PiGlowArduinoDemo/PiGlowArduinoDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "PiGlow.h"

#define PIGLOW_RING_RED 0
#define PIGLOW_RING_YELLOW 1
#define PIGLOW_RING_ORANGE 2
#define PIGLOW_RING_ORANGE 1
#define PIGLOW_RING_YELLOW 2
#define PIGLOW_RING_GREEN 3
#define PIGLOW_RING_BLUE 4
#define PIGLOW_RING_WHITE 5
Expand Down
17 changes: 17 additions & 0 deletions PiglowArduinoTest/PiglowArduinoTest.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <Wire.h>
#include "PiGlow.h"

#define BRIGHTNESS 50

PiGlow piglow;

void setup() {
piglow.setup(BRIGHTNESS);
piglow.reset();
}

void loop() {
for(int pin = 0;pin<18;pin++){
piglow.write(pin,10);
}
}