OH yey, I got it working(Sorta)
Kay, well I woke up this morning and the proper idea of what I'm supposed to be doing popped into my head.
First: The code:
//pins
int latchPin = 13;
int clockPin = 12;
int dataPin = 11;
//Decimal value to output
int d = 170;
void setup() {
//Start serial to debug/send values
Serial.begin(9600);
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
//If there's something new
if (Serial.available() > 0) {
// read the incoming byte:
d = Serial.read();
}
//ground latchPin and hold low for as long as you are transmitting
digitalWrite(latchPin, LOW);
//Repeat the 8 bit pattern 8 times
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
shiftOut(dataPin, clockPin, MSBFIRST, d);
//latch up
digitalWrite(latchPin, HIGH);
//Send that it's done.
Serial.print("DONE!");
Serial.println();
//Print last byte
Serial.print(d);
Serial.println();
Serial.println();
}
Kay, so the way I have it now, I use a Binary converter to convert a pattern of 1's and 0's to a decimal number, I then define it as "d"
With the current code, when I run it, it outputs the proper pattern, sends the number back through serial, and all works swell.
BUT
When I try to send it any number through serial(8 bit or otherwise) the feedback seems to bounce some(as do the lights) then it pretty much always fixiates on "51"
EDIT: IT seems to not fixiate on 51, if I type in jibberish, it gives me 100, and if I type in 11, it gives me 49, so it seems to be converting something, any way to make it stop/counter act it?
I'm assuming that it's having a problem with the serial not being "Timed" properly, but I tried sending it a bunch of times in a row(To hope that I hit the right timing point) but nothing
BTW.
For the uninformed, colorful code comes from the Tools > Copy For Forum menu in the Arduino IDE