Skip to content

Instantly share code, notes, and snippets.

@raster
Created January 19, 2011 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raster/786551 to your computer and use it in GitHub Desktop.
Save raster/786551 to your computer and use it in GitHub Desktop.
Arduino ShiftBrite code
/*
* ShiftBrite.pde
*
* See also: http://rasterweb.net/raster/2011/01/17/perl-arduino-shiftbrite/
* See also: http://code.google.com/p/shiftbritehughesyarduino/
*
*/
#include "HughesyShiftBrite.h"
HughesyShiftBrite sb;
void setup() {
sb = HughesyShiftBrite(10,11,12,13);
sb.sendColour(10,10,10);
Serial.begin(9600);
}
void loop() {
int input = Serial.read();
switch (input) {
case 48:
sb.sendColour(0,0,100);
break;
case 49:
sb.sendColour(0,0,200);
break;
case 50:
sb.sendColour(0,0,400);
break;
case 51:
sb.sendColour(0,0,600);
break;
case 52:
sb.sendColour(0,400,0);
break;
case 53:
sb.sendColour(0,600,0);
break;
case 54:
sb.sendColour(0,800,0);
break;
case 55:
sb.sendColour(600,0,0);
break;
case 56:
sb.sendColour(800,0,0);
break;
case 57:
sb.sendColour(1000,0,0);
break;
}
delay(5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment