Nechápem komu môže stačiť útlm 63db. Ja potrebujem ked regulujem cez foobar2000 okolo 90db, na uplné ticho viac... Tak google som samozrejme skúšal. Ten prvý projekt má len 6 relé po 1db a vôbec nemá displej. Takže by sa to muselo dosť preprobiť. To od AMB vyzerá lepšie ale ked dobre vidím nemá to encoder ale potenciometer s motorom. celkom šlialená kombinácia. Takže je otázka či nie je lepšie urobiť to od základu.
Asi to skúsim zobrať postupne. Do môjho programu čo už mám doplním tie riadky pre LCD a nechám tam pre začiatok celé čísla a 255 krokov. Displej by som volil SPI, je perfektné že to má len 2 vodiče. Displej by som teda skúsil rovno OLED a LCD preskočil. Po tom čo skončím s pokusmi si ho aj tak nechám pre "final". Myslím že tento by mohol byť dobrý http://www.tme.eu/sk/details/eaw162-x3l … 162-x3lw/# .Netvrdím že sa nič lacnejšie nenájde ale nemám chuť kvôli tomu riešiť ebay, paypal, účty a čakať na free shipping. Z TME to mám hned doma za poštovné 2,9e a tiež je vysoká prevdepodobnosť že za rok si tam môžem kúpiť ten istý.
Takto vyzerá môj program čo sme robili s kamarátom SW programátorom. Ako ythren potvrdil, nie je napísaný najštastnejšie. Ale funguje
// constants won't change. They're used here to
// set pin numbers:
const int buttonPinUp = 13; // tlacitko up
const int buttonPinDown = 11; // tlacitko down
const int ledPin1 = 9; // the number of the LED pin
const int ledPin2 = 10; // the number of the LED pin
const int ledPin3 = 12;
const int ledPin4 = 8;
const int ledPin5 = 7;
const int ledPin6 = 6;
const int ledPin7 = 5;
const int ledPin8 = 4;
const int ochrana = 100;
// variables will change:
int buttonStateUp; // the current reading from the input pin
int buttonStateDown; // the current reading from the input pin
int lastButtonStateUp = LOW; // the previous reading from the input pin
int lastButtonStateDown = LOW; // the previous reading from the input pin
int stateLed = 1; // stav - kolko lediek bude svietit
int maxLed = 255; // stav - kolko lediek bude svietit
int _step = 0;
// the following variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lastDebounceTimeUp = 0; // the last time the output pin was toggled
long lastDebounceTimeDown = 0; // the last time the output pin was toggled
long lastOchrana = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPinUp, INPUT);
pinMode(buttonPinDown, INPUT);
int buttonState_1 = HIGH;
int buttonState_2 = LOW;
}
void loop(){
int readingUp = digitalRead(buttonPinUp);
int readingDown = digitalRead(buttonPinDown);
// If the switch changed, due to noise or pressing:
if (readingUp != lastButtonStateUp) {
// reset the debouncing timer
lastDebounceTimeUp = millis();
}
if (readingDown != lastButtonStateDown) {
lastDebounceTimeDown = millis();
}
if ((millis() - lastDebounceTimeUp) > debounceDelay) {
if(lastOchrana+ochrana < millis() && readingUp == HIGH && stateLed < maxLed){
stateLed++;
lastOchrana = millis();
}
}
if ((millis() - lastDebounceTimeDown) > debounceDelay) {
if(lastOchrana+ochrana < millis() && readingDown == HIGH && stateLed > 0){
stateLed--;
lastOchrana = millis();
}
}
//Ledka 1:
if(stateLed % 2 == 1){
digitalWrite(ledPin1, HIGH);
}else{
digitalWrite(ledPin1, LOW);
}
//Ledka 2:
if((stateLed / 2) % 2 == 1){
digitalWrite(ledPin2, HIGH);
}else{
digitalWrite(ledPin2, LOW);
}
//Ledka 3:
if(((stateLed / 2) / 2) % 2 == 1){
digitalWrite(ledPin3, HIGH);
}else{
digitalWrite(ledPin3, LOW);
}
//Ledka 4:
if((((stateLed / 2) / 2) / 2) % 2 == 1){
digitalWrite(ledPin4, HIGH);
}else{
digitalWrite(ledPin4, LOW);
}
//Ledka 5:
if(((((stateLed / 2) / 2) / 2) / 2) % 2 == 1){
digitalWrite(ledPin5, HIGH);
}else{
digitalWrite(ledPin5, LOW);
}
//Ledka 6:
if((((((stateLed / 2) / 2) / 2) / 2) / 2) % 2 == 1){
digitalWrite(ledPin6, HIGH);
}else{
digitalWrite(ledPin6, LOW);
}
//Ledka 7:
if(((((((stateLed / 2) / 2) / 2) / 2) / 2) / 2) % 2 == 1){
digitalWrite(ledPin7, HIGH);
}else{
digitalWrite(ledPin7, LOW);
}
//Ledka 8:
if((((((((stateLed / 2) / 2) / 2) / 2) / 2) / 2) / 2) % 2 == 1){
digitalWrite(ledPin8, HIGH);
}else{
digitalWrite(ledPin8, LOW);
}
// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonStateUp = readingUp;
lastButtonStateDown = readingDown;
}
Zatial som to skúšal len s LEDkami, takže nevadilo že "hrá" na plno