Skip to content
Browse files

changed LED class constructor so it goes RGB instead of GBR

  • Loading branch information...
1 parent c3eed88 commit 4dbdd53e982f676c3f17d27e33289b5725c88988 @speckles speckles committed
Showing with 7 additions and 6 deletions.
  1. +7 −6 Train-Overlord.pde
View
13 Train-Overlord.pde
@@ -14,13 +14,14 @@ class LED
public:
LED(int,int,int);
void setColor(int);
-
+
+ int PinRed;
int PinGreen;
int PinBlue;
- int PinRed;
+
};
-LED::LED (int pinG, int pinB, int pinR) {
+LED::LED (int pinR, int pinG, int pinB) {
PinGreen = pinG;
PinBlue = pinB;
PinRed = pinR;
@@ -68,7 +69,7 @@ void LED::setColor(int color) {
#include <AFMotor.h>
-LED myLED(6,5,3);
+LED myLED(3,4,5);
AF_DCMotor motor1(1, MOTOR12_8KHZ); //create motor #1, 64KHz pwm
void setup()
@@ -76,12 +77,12 @@ void setup()
motor1.setSpeed(200); //set the speed to 200/255
motor1.run(RELEASE);
pinMode(myLED.PinRed, OUTPUT);
- pinMode(myLED.PinBlue, OUTPUT);
pinMode(myLED.PinGreen, OUTPUT);
+ pinMode(myLED.PinBlue, OUTPUT);
digitalWrite(myLED.PinRed, HIGH);
+ digitalWrite(myLED.PinGreen, HIGH);
digitalWrite(myLED.PinBlue, HIGH);
- digitalWrite(myLED.PinGreen, HIGH);
}

0 comments on commit 4dbdd53

Please sign in to comment.
Something went wrong with that request. Please try again.