Welcome, Guest
Username: Password: Remember me

TOPIC: How to start programming pedalSHIELD

How to start programming pedalSHIELD 1 year 7 months ago #26

  • JR
  • JR's Avatar
  • OFFLINE
  • Moderator
  • Posts: 77
  • Thank you received: 23
  • Karma: 5
This is a short guide to start coding pedalSHIELD. 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.

pedalshield-pinout_2013-12-03.jpg


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:

pedalshield-cables.jpg



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.

You can also download them all in a .rar file:

File Attachment:

File Name: 00.pedalSHIELD_2015-04-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
Last Edit: 2 months 2 weeks ago by Ray.
The administrator has disabled public write access.
The following user(s) said Thank You: christiangraves, KennethDStewart

How to start programming pedalSHIELD 1 year 3 months ago #107

  • dra9his
  • dra9his's Avatar
  • OFFLINE
  • New Member
  • Posts: 1
  • Karma: 0
What library need to add?
How can I get away from '->' is not a pointer?

Thanks a lot!
The administrator has disabled public write access.

How to start programming pedalSHIELD 1 year 3 months ago #108

  • JR
  • JR's Avatar
  • OFFLINE
  • Moderator
  • Posts: 77
  • Thank you received: 23
  • Karma: 5
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
Last Edit: 1 year 3 months ago by JR.
The administrator has disabled public write access.

How to start programming pedalSHIELD 10 months 4 weeks ago #138

  • mikemac
  • mikemac's Avatar
  • OFFLINE
  • New Member
  • Posts: 2
  • Karma: 0
int POT0, POT1, POT2; //variables for 3 pots (ADC8, ADC9, ADC10)

sorry for out of topic question.
i wanted to know how arduino works that POT0 is on ADC 8 without a code that states POT0 = adc8 ?
thanks
The administrator has disabled public write access.

How to start programming pedalSHIELD 10 months 2 weeks ago #144

  • JR
  • JR's Avatar
  • OFFLINE
  • Moderator
  • Posts: 77
  • Thank you received: 23
  • Karma: 5
The POT0 is physically connected to the ADC8 of the Arduino Due board (you can check the Arduino Due pinout)

When the ADCs are read in the main loop we have:
POT0=ADC->ADC_CDR[10];                // read data from ADC8    
At this point the ADC8 value is loaded in the POT0 variable.
keep it simple
The administrator has disabled public write access.

How to start programming pedalSHIELD 10 months 1 week ago #147

  • mikemac
  • mikemac's Avatar
  • OFFLINE
  • New Member
  • Posts: 2
  • Karma: 0
but it written ADC_CDR[10]
why the numer 10 refers to ADC 8 ?
The administrator has disabled public write access.

How to start programming pedalSHIELD 9 months 17 hours ago #159

  • JR
  • JR's Avatar
  • OFFLINE
  • Moderator
  • Posts: 77
  • Thank you received: 23
  • Karma: 5
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
Last Edit: 9 months 17 hours ago by JR.
The administrator has disabled public write access.

How to start programming pedalSHIELD 5 months 3 days ago #198

  • jasolag
  • jasolag's Avatar
  • OFFLINE
  • New Member
  • Posts: 5
  • Karma: 1
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
Last Edit: 5 months 3 days ago by jasolag. Reason: Additional info
The administrator has disabled public write access.

How to start programming pedalSHIELD 5 months 3 days ago #200

  • shanemikel
  • shanemikel's Avatar
  • OFFLINE
  • New Member
  • Posts: 17
  • Thank you received: 2
  • Karma: 0
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
Last Edit: 5 months 3 days ago by shanemikel.
The administrator has disabled public write access.
The following user(s) said Thank You: Ray

How to start programming pedalSHIELD 5 months 3 days ago #202

  • Ray
  • Ray's Avatar
  • OFFLINE
  • Moderator
  • Posts: 51
  • Thank you received: 14
  • Karma: 0
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 administrator has disabled public write access.
Moderators: JR
Time to create page: 0.437 seconds
Powered by Kunena Forum