Monday, December 10, 2007
Sunday, December 9, 2007
Xylophone Send and Receive code
//boolean keyHit = false;
int potPin = 2;
int ledPin = 13;
int val = 0;
int keyHit[] = {0,0,0,0,0,0,0,0};
void setup() {
Serial.begin(9600);
for(int x=0;x<=5;x++) {
pinMode(x, INPUT);
}
for(int y=8;y<=13;y++) {
pinMode(y, OUTPUT);
}
}
void loop() {
for(int i=0; i<=7; i++){
val = analogRead(i);
// Serial.println(i);
/* if(val > 40 && keyHit == false) {
Serial.println(i);
// Serial.print(" hit");
Serial.println(val);
keyHit = true;
digitalWrite(i+7, HIGH);
delay(30);
digitalWrite(i+7, LOW);
delay(200);
break;
} */
if(val > 40 && keyHit[i] == 0) {
Serial.println(i);
// Serial.print(" hit");
Serial.println(val);
keyHit[i] = 1;
digitalWrite(i+8, HIGH);
delay(30);
digitalWrite(i+8, LOW);
delay(100);
break;
}
else if (val == 0) {
keyHit[i] = 0;
}
}
}
int potPin = 2;
int ledPin = 13;
int val = 0;
int keyHit[] = {0,0,0,0,0,0,0,0};
void setup() {
Serial.begin(9600);
for(int x=0;x<=5;x++) {
pinMode(x, INPUT);
}
for(int y=8;y<=13;y++) {
pinMode(y, OUTPUT);
}
}
void loop() {
for(int i=0; i<=7; i++){
val = analogRead(i);
// Serial.println(i);
/* if(val > 40 && keyHit == false) {
Serial.println(i);
// Serial.print(" hit");
Serial.println(val);
keyHit = true;
digitalWrite(i+7, HIGH);
delay(30);
digitalWrite(i+7, LOW);
delay(200);
break;
} */
if(val > 40 && keyHit[i] == 0) {
Serial.println(i);
// Serial.print(" hit");
Serial.println(val);
keyHit[i] = 1;
digitalWrite(i+8, HIGH);
delay(30);
digitalWrite(i+8, LOW);
delay(100);
break;
}
else if (val == 0) {
keyHit[i] = 0;
}
}
}
Saturday, December 1, 2007
Transistor Array Vs. Array of Transistors
Originally, we were working with a transistor array, also known as a Darlington Array. This was the only variety locally available. It worked for a few hours and then stop working.
After looking as specs and talking to several people, it appears that this variety of transistor array is not rated to handle the amperage output of the solenoids. While the running amperage was fine, the startup was not.
This leads us to use an array of TIP120s that can handle the amperage. The TIP120s also use a 1N4004 diode.
Refer here for more information.
After looking as specs and talking to several people, it appears that this variety of transistor array is not rated to handle the amperage output of the solenoids. While the running amperage was fine, the startup was not.
This leads us to use an array of TIP120s that can handle the amperage. The TIP120s also use a 1N4004 diode.
Refer here for more information.
Subscribe to:
Posts (Atom)