This shows you the differences between two versions of the page.
pm:prj2022:sgherman:guitar_pedal [2022/06/01 02:17] cristina.grigore00 [Setup] |
pm:prj2022:sgherman:guitar_pedal [2022/06/02 01:52] (current) cristina.grigore00 [Bibliografie/Resurse] |
||
---|---|---|---|
Line 52: | Line 52: | ||
===== Setup ===== | ===== Setup ===== | ||
- | In etapa de setup, configurez Timer-ul 0 si Timer-ul 2 pe fastPWM 8-bit inverting, prescaler 2, duty cycle 0. Configurez ADC-ul: tensiunea de referinta la 1.1V si prescaler-ul la 32. | + | In etapa de setup, configurez Timer-ul 0 si Timer-ul 2 pe fastPWM 8-bit inverting, prescaler 2. Configurez ADC-ul: tensiunea de referinta la 1.1V si prescaler-ul la 32. |
<code> | <code> | ||
void waveformGenerationMode(int pin) { | void waveformGenerationMode(int pin) { | ||
Line 71: | Line 71: | ||
} | } | ||
</code> | </code> | ||
+ | <code> | ||
+ | analogReference(INTERNAL); | ||
+ | //set the ADC's prescaler to a low value (32) | ||
+ | ADCSRA &= ~B111; // clear analog prescale | ||
+ | ADCSRA |= B101; | ||
+ | </code> | ||
===== Input Switch ===== | ===== Input Switch ===== | ||
- | Pentru citirea input-ului de la utilizator citesc valoarea de pe pinul A2 pentru pozitia switch-ului rotativ si obtin o valoare discreta(variabila ''mode''). pentru fiecare dintre cele 9 pozitii, desi am ales sa implementez doar 2 efecte pentru 2 pozitii din considerente de lipsa de memorie.\\ Variabila ''fx'' contine inputul de pe potentiometrul P3 ce ajusteaza intensitatea efectului. | + | Pentru citirea input-ului de la utilizator citesc valoarea de pe pinul A2 pentru pozitia switch-ului rotativ si obtin o valoare discreta(variabila ''mode''). pentru fiecare dintre cele 9 pozitii, desi am ales sa implementez doar 2 efecte pentru 2 pozitii din considerente de lipsa de memorie.\\ Variabila ''fx'' contine inputul de pe potentiometrul P1 ce ajusteaza intensitatea efectului. |
<code> | <code> | ||
void readKnobs(){ | void readKnobs(){ | ||
Line 86: | Line 92: | ||
</code> | </code> | ||
===== Efecte ===== | ===== Efecte ===== | ||
- | Am ales sa implementez 2 efect: un delay si un overdrive. | + | Am ales sa implementez 2 efecte: un delay si un bitcrusher. |
- | ===== Setup ===== | + | <code> |
+ | // *************** | ||
+ | // ***Overdrive*** | ||
+ | // *************** | ||
+ | if(mode == 13){ | ||
+ | value50 = 1 + ((float) fx / (float) 20); | ||
+ | byte input = analogRead(left); | ||
+ | input = (input * value50); | ||
+ | output(input); | ||
+ | } | ||
+ | </code> | ||
+ | <code> | ||
+ | // ************* | ||
+ | // ***bitcrush** | ||
+ | // ************* | ||
+ | if(mode == 6){ | ||
+ | value300 = 1 + ((float) fx / (float) 3); | ||
+ | if(delayed > value300) { | ||
+ | byte input = analogRead(left); | ||
+ | input = (input >> 6 << 6); | ||
+ | output(left, input); | ||
+ | delayed = 0; | ||
+ | } | ||
+ | delayed++; | ||
+ | |||
+ | } | ||
+ | </code> | ||
===== Rezultate Obţinute ===== | ===== Rezultate Obţinute ===== | ||
Line 97: | Line 129: | ||
===== Download ===== | ===== Download ===== | ||
- | <note tip> | + | |
- | </note> | + | {{:pm:prj2022:sgherman:arduino_guitar_pedal.zip|}} |
===== Jurnal ===== | ===== Jurnal ===== | ||
Line 109: | Line 142: | ||
<note> | <note> | ||
- | [[https://www.instructables.com/Arduino-Guitar-Pedal/]] | + | [[https://www.instructables.com/Arduino-Guitar-Pedal/]]\\ [[https://www.electrosmash.com/pedalshield-uno]] |
- | [[https://www.electrosmash.com/pedalshield-uno]] | + | |
</note> | </note> | ||
- | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | + | {{:pm:prj2022:sgherman:arduino_guitar_pedal_1_.pdf|}} |