How to start programming pedalSHIELD

10 years 4 months ago - 7 years 2 months ago #26 by JR
This is a short guide to start coding pedalSHIELD DUE. I am going to explain just the basic ideas you need to know to progress as fast as possible.

1. What Do You Need to Know About the Hardware?
If you know nothing about electronics it's ok!, you just need to know how the hardware resources are mapped.



Inputs:
ADC0: Guitar in.
ADC1: Guitar in.
ADC8: Potentiometer 0.
ADC9: Potentiometer 1.
ADC10: Potentiometer 2.
PIN7 (PWM7): FootSwitch.
PIN2 (PWM2): Toggle button.

Outputs:
DAC0: Pedal out.
DAC1: Pedal out.
PIN3 (PWM3): LED.

2. Installing the Software.
The integrated development environment (IDE) software for Arduino DUE is needed. It is available in the Arduino Software page with all the instructions. There is also a getting started with Arduino DUE guide for further details.

With the latest 1.6.3 code check this " How to install Arduino DUE in the latest 1.6.3 Software ".

Once all the software is installed the environment should look like this:




3. Start Coding!
There is a series of pedals already available in the forum. All this effects have "educational" purposes. The idea is to have them as a base to start improving or coding your own effects, so the codes have a balance between performance and complexity to understand.
Going from the easiest to the most difficult, the natural evolution is:
  1. Clean/Volume/Booster pedal
  2. Distortion pedal.
  3. Clean Sampled pedal.
  4. Delay pedal.
  5. Echo pedal.
  6. Octaver pedal.
  7. Reverb pedal.
  8. Sinewave Generator.
  9. Metronome.
  10. Tremolo.
  11. Chorus/Vibrato.

Other interesting codes submitted by users:
You can also download them all in a .rar file:

File Attachment:

File Name: 00.pedalSH...4-16.rar
File Size:22 KB


There is a topic explaining how to include the example pedals into the Arduino Software (IDE) , it gives you easy acces and fast loading.

There is also a Github repository with all the codes.

keep it simple
Attachments:
The following user(s) said Thank You: christiangraves, KennethDStewart, AndrewHPavei, sparko

Please Log in to join the conversation.

10 years 2 weeks ago #107 by dra9his
What library need to add?
How can I get away from '->' is not a pointer?

Thanks a lot!

Please Log in to join the conversation.

10 years 2 weeks ago - 10 years 2 weeks ago #108 by JR
You do nt need to install any additional libraries, all the codes are error-free and only use Arduino standard libraries.
Just be sure that you are using the right Arduino software, currently the Arduino 1.5.6-r2 BETA (with support for Arduino Yún and Arduino Due boards)

keep it simple

Please Log in to join the conversation.

9 years 8 months ago #138 by mikemac

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

9 years 8 months ago #144 by JR

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

9 years 7 months ago #147 by mikemac
but it written ADC_CDR[10]
why the numer 10 refers to ADC 8 ?

Please Log in to join the conversation.

9 years 6 months ago - 9 years 6 months ago #159 by JR

but it written ADC_CDR[10]
why the number 10 refers to ADC 8 ?


In the Arduino DUE pinout you can see that the pin marked as A8 (ADC8) is internally connected to the AD10 (Analog to Digital converter number 10).

keep it simple

Please Log in to join the conversation.

9 years 2 months ago - 9 years 2 months ago #198 by jasolag
Hi
I'm a bit confused about the toggle switches. Why does the program register only 1 pin for the toggle switches when there are 2? Also, how can I use the toggle switches to switch between different effects.

Also, I'm fairly new to Arduino but I'm planning to write a program that will allow the pedal to act as a tuner pedal (maybe fast LED blinks for sharp notes and no LED for flat notes, with LED on HIGH at the correct pitch). Can anyone help me with pitch recognition? Thanks

Please Log in to join the conversation.

9 years 2 months ago - 9 years 2 months ago #200 by shanemikel
Only one of the switches is actually connected to an io pin, the other is there for re-routing the circut so that the original input signal is mixed with the output signal. Some effects discard the original signal in favor of the new, proccessed one (like overdrive/distortion), where some effects (like delay/reverb) need the original signal to pass through as well as the modified (in this case delayed) signal. The reasoning behind this dedicated switch, is it keeps the effects that use it much simpler (putting less work on the programmer and the arduino).

I have some advice as someone who built this pedal within the month; Read through the entire forum (software AND hardware section). There is a thread here about how to code multiple effects in one sketch (program). Also, at first, I thought I had messed up the build, but really the shield just wasn't all the way pushed into the arduino, so don't be afraid to apply some pressure to get it in there.

Adjusting the trimmer is an important step (the component in RV1 that is adjustable with a screwdriver). There is a sketch in the github repo for assisting with this, and a thread here on the forum.

Second, try not to be too surprised or disapointed when you try it for the first time, as the arduino microcontrollers pick up and generate quite a bit of noise (there WILL be a rather prominent hiss in the processed signal). There are several different things you can try to mitigate this. Somebody has JUST posted a thread about a way to do this with a software low-pass filter (I have yet to try it), and I am going to try averaging to see how that works as well.

Good Luck
The following user(s) said Thank You: Ray

Please Log in to join the conversation.

9 years 2 months ago #202 by Ray
yes, shanemikel is completely right, in a nutshell:
  • switch 2 (on the left): is an analog mixer (mix the input signal with the output signal)
  • switch 3 (on the right): is a programmable (pin PMW2)

There is topic explaining hot to select between effects using the switch 3 .

About the pitch recognition it is an interesting idea, there are several approaches to do it, there is a book called " Electronics for Guitarist " where I remember there is a chapter (or part of a chapter) dedicated to explain how it works.

You can try to simplify the algorithm because it is not trivial:
- Maybe adding a high gain to the input signal (like a distortion pedal) in order to make square the sinusoidal input signal and after it try to count the number of samples that the signal is high and low.... just an idea.
The following user(s) said Thank You: untitled92

Please Log in to join the conversation.

Time to create page: 0.130 seconds