Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Modifying the pins that FreqMeasure library uses

  1. #1
    Junior Member
    Join Date
    Aug 2016
    Posts
    2

    Modifying the pins that FreqMeasure library uses

    Hi,

    I am using the FreqMeasure library with Arduino UNO for an automatic guitar tuner and it works great! thank you so much, somehow i couldn't get FreqPeriod work, and i wasted lots of days, but FreqMesure was my savior

    my question as it is in thread title: is it possible to modify the pins that the library uses? because i would like to use a TFT LCD as user interface, and it's some kind of cheap chinese product, and it only works with digital pins 8 and 9, which FreqMeasure already uses... :S so i was wondering if i could switch the pins from 8 (9 and 10?) to some other three digital pins? if it could work, how should i modify the code?
    I'm sorry if the answers would be evident, but i'm just a beginner, so i thought it would be faster if i asked

  2. #2
    Senior Member
    Join Date
    Nov 2015
    Location
    Wales
    Posts
    579
    Pin 8 is the ICP1 (Input Capture Pin 1). As there is only one of these you can not switch the pin

    Unfortunately this is also the RX pin which is probably needed for your TFT LCD.

    Can you post the part number of your LCD? You maybe able to drive it with just the TX pin (Pin 9)

  3. #3
    Junior Member
    Join Date
    Aug 2016
    Posts
    2
    Thanks for your reply, but since then I solved my problem by using the same LCD with an Arduino MEGA, so the pins required by FreqMeasure are free this way

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,596
    If you ever decide to make a more advanced version, check out the Teensy audio library notefreq analysis. It uses the YIN algorithm, which is much better than turning the signal into digital pulses for FreqMeasure. Even when there's strong harmonics which cause the digital signal to become a harmonic of the note, the YIN algorithm can find the note's fundamental.

    http://www.pjrc.com/teensy/gui/?info...eNoteFrequency

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •