hola foro, antes de nada dar la enhorabuena a todos los que haceis posible este portal,gracias por vuestro altruismo hacia los demas.
mi duda es la siguiente, me estoy haciendo una pedalera para guitarra y consta de 12 pulsadores iluminados, pero no consigo diseñar un circuito(mis nociones de electronica son escasas) que deje iluminados los pulsadores aunque no esten pulsados, es decir, seleccion el pulsador del efecto 1, y cuando suelte se sigue quedando encendido, y cuando vuelva a pulsar se apague, algo asi como esto:
Pulsador off-led off(partimos de que esta apagado)
pulsador on-luz on( se pulsa el boton, el led se enciende)
pulsador off-luz on(se suelta el boton, el led sigue luciendo)
pulsador on-luz off(se pulsa para volver a apagar, el led se apaga)
lo intento simular pero solo llego hasta aqui...
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
a pesar de que la pedalera lleve 12 botones, con que lo consigamos con uno me es suficiente.para cualquier cosa de la pedalera me podeis preguntar y os paso planos etc...gracias a todos!
mi duda es la siguiente, me estoy haciendo una pedalera para guitarra y consta de 12 pulsadores iluminados, pero no consigo diseñar un circuito(mis nociones de electronica son escasas) que deje iluminados los pulsadores aunque no esten pulsados, es decir, seleccion el pulsador del efecto 1, y cuando suelte se sigue quedando encendido, y cuando vuelva a pulsar se apague, algo asi como esto:
Pulsador off-led off(partimos de que esta apagado)
pulsador on-luz on( se pulsa el boton, el led se enciende)
pulsador off-luz on(se suelta el boton, el led sigue luciendo)
pulsador on-luz off(se pulsa para volver a apagar, el led se apaga)
lo intento simular pero solo llego hasta aqui...
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
a pesar de que la pedalera lleve 12 botones, con que lo consigamos con uno me es suficiente.para cualquier cosa de la pedalera me podeis preguntar y os paso planos etc...gracias a todos!