Multi-function shield for Arduino

Arduino Multi-function Shield Projects

Introduction to the Coding Series

Simple I/O that is usually taken for granted on PCs, like reading key presses, outputting to a display, and sounding an alarm, often get in the way of the focus of the main task when developing for microcontrollers. It is for this reason we have developed a library for the multi-function shield we have chosen, and that which simplifies basic I/O operations. We also provide a set of real world applications that make use of this library, so those new to coding on the Arduino can experiment with and enhance them.

Some familiarity with the Arduino platform is assumed, as is the installation of the Arduino development environment. We got our shield from Hobby Components, but there are a number of other suppliers too. NOTE there are numerous versions of this shield, with some using a different LED display that requires some minor modifications in the library code. The simplest of the changes is to modify all implementations of WriteValueToSegment() in file MultiFuncShield.cpp. Please see the comments section.

Some shields have a passive beeper, and others have an active beeper. Presently, our library only supports the active beeper, although you should still be able to use the passive beeper with your own code.

Installing the Arduino multi-function shield library

For earlier versions of the shield library, you will need to first install the TimerOne and Software I2C libraries using instructions for installing Arduino libraries. The most recent library no longer needs TimerOne or Software I2C. You can download the multi-function shield library from the link below and install using the instructions from the link above:

Although we do everything to ensure our downloads are free from viruses and malware, please check that your virus and malware scanning software is up to date before hand.

We must point out that by following the Hackatronics series, you agree to do so at your own risk, and agree to take full responsibility for any loss or damages you may incur upon yourself or others. If you’re a youngster starting out, be sure to have supervision of a responsible adult.

More about this series

This series is divided in to three main parts (and is also available as an eBookplease only download from this web site):

  1. Basic Input / Output
  2. Reading Sensors
  3. Real World Applications

Part 1 demonstrates the ease with which the Arduino multi-function shield buttons, beeper and display can utilised by using the shield library, thereby making it easier to concentrate on the logic of the application. Part 2 demonstrates how the shield library can be used to read values from external sensors, such as temperature, sonar and motion sensors, and how to process electronic pulses from an external source. Part 3 explores working applications using the library and the Arduino multi-function shield:

  • 24 hour alarm clock
  • Heart monitor   – (requires heart pulse sensor)
  • Count down timer
  • Surface incline level indicator– (requires MPU6050 motion sensor)
  • Sonar ranger   – (requires HC SR04 sonar module)
  • Speedometer   – (requires magnet and reed switch)

Each of these has scope to be built upon and expanded, but we leave that to you. Get coding and have fun!

New! Want to control your Arduino with an internet browser? Check out our new Arduino Web Server.

74 thoughts on “Arduino Multi-function Shield Projects

  1. bill

    hi.. if i want all the times a value px 1.00 min or 1.30 how can store the time ??i mean the board and arduino its off ..power on and start with last timer settings .and if easy if start the timer to countdown to open a relay and closed if finish the timer ??.any help
    thanks for your time and nice video

    Reply
    1. Kashif Baig Post author

      Hi Bill, I’m not sure I fully understand the first part of your question. It is possible to store the timer value in the Arduino’s eeprom, but be aware that after about 100000 memory write operations, the eeprom becomes unreliable. The best way to do this would be store the timer value in eeprom just before powering off, but you would need special circuitry for that. You would read the timer value in eeprom on power up.

      To power a relay would need a driver IC. A mosfet IC might be a possible alternative to a relay.

      Reply
  2. Luciano usuelli

    Ho caricato lo sketch led display ma non parte
    Ho caricato le librerie che voi suggerite ma sembra che la libreria multifunction non funzuona
    Cosa posso fare?
    Grazie per la aiuto

    Reply
    1. Cohesive Computing

      Hi Luciano

      It is possible the library has not installed properly. Have you tried copying the library bundle file instead?

      Reply
  3. Alaiksander

    I’m planning to make a pH controller. I’m thinking to purchase the hardwares. My setup will be 2 peristaltic pumps to pump pH UP and pH Down and a pH probe. I already have a 4x5v relays. Will this shield help me to achieve my setup?

    Reply
  4. Walter Pletscher

    Congratulation for this very useful tool. It helped a great deal to get first hand experiences with a variety of Arduino related applications. My question is related to Part 3 – Speedometer. After powering the Arduino, the shield display starts counting back (even without holding button 1) until the number 30 appears (diameter of wheel). The sketch doesn’t react on button 2 or 3 for diameter changes. Sketch compile and upload without any error indication. Would appreciate a short feedback. Using Arduino UNO R3. Thanks.

    Reply
    1. Kashif Baig Post author

      Hi Walter

      Do the other sketches have similar problems, or just the speedometer? I’m assuming you downloaded the source code zip file from here: https://www.cohesivecomputing.co.uk/hackatronics/arduino-multi-function-shield/

      I’m also assuming the correct board was selected in Arduino studio. Are you using a genuine Arduino UNO, or compatible clone? Btw, I haven’t tested the sketches using the SMD UNO, in case you’re using that edition. If you are, try using the 1.0 version of the library using the link I just mentioned.

      Reply
      1. Walter Pletscher

        Dear Kashif,
        appreciate your immediate feedback – good support. Following replies:
        – I’ve tested about 6-8 other sketches with no problems at all
        – downloaded the source code (cut/paste into my arduino UNO) from your document (page 25,26)
        – using an Arduino UNO – original no compatible
        – I’ve not tested the sketch with Version 1.0 of the library

        Reply
        1. Kashif Baig Post author

          Walter, I’ve pasted the same code from the document and can confirm that it does indeed work correctly. It is possible in your case the copy/paste has gone wrong somewhere. The full source code is available as a zip file from the link in my previous reply. Have you tried using that instead?

          Reply
          1. Walter Pletscher

            Kashif, I’ve used the sketch from your source also, but the result remains the same. A test with older libraries – same result. I can only explain the wrong going, with the Multifunction Board I’ve got from the attached source:

            https://www.ebay.com/itm/172308245385

            Please provide the source for your “original” board. Thanks a lot – appreciate again your help.

          2. Kashif Baig Post author

            I have a number of these shields from different sources, including one that is just like you have (look where it is written multi function shield, it is spelled incorrectly). Do you have a jumper block on both J2 pins? Could you also provide a link to the exact Arduino you have.

            Upload and run the Buttons sketch in the Basic Input Output folder of the source code zip file, and open the serial monitor. If no buttons are pressed, nothing should be output in the serial monitor. If you are getting false readings, then run the same sketch without the shield. If the false readings stop, it could be a faulty shield.

  5. Walter Pletscher

    Good evening Kashif,
    perfect advice. It was the missing jumper on J2. I can modify wheel diameter (up or down) with either button 2 or button 3. Thank you for your help. And by the way, it’s a board with the name multi function shield spelled incorrectly. I use an Arduino UNO Board Model UNO R3 with a DIL Version of the ATMEGA328P-PU.

    I would like to adapt your sketch for very tiny wheel diameters (9 to 11mm) and the application will be speed and distance measurement for my model train (H0 scale).
    Once again, your support was just excellent – thank you.

    Reply
  6. olugbenga adebanjo

    Hi Kashif and welldone for the amazing work you’re doing. I am trying to implement your code on a new but generic MFB. At the moment I can’t get to hear any beeping sound both for the countdown and the alarm clock. Also, how does the J1 and J2 work?

    Thanks in advance for your support.

    Reply
  7. Luis Enrique Piña Juárez

    Hi, im using the countdown for testing, but I have isuues with the 5 and 6, showing a 9 istead a 5, and a 8 instead the 6, do you know what could be causing this ?

    Reply
    1. Kashif Baig Post author

      Hi Luis. With some Arduinos, the metal part of the USB connector makes contact with connections under the shield. If that is what you are experiencing, then insulate the part of the USB connector that makes contact.

      Reply
  8. Wolfgang

    Hi. I have a question.
    When the sketch starts, the display is powered off. When it shows a digit or a letter, if i do MFS.write(OFF) it doesnt power off the display and shows a 0. How can i turn off the display??
    This is the sketch i am trying:

    #include
    #include
    #include

    void setup(){
    Timer1.initialize();
    MFS.initialize(&Timer1);
    }

    void loop(){
    int button;
    byte btn = MFS.getButton();
    if (btn){

    byte buttonNumber = btn & B00111111;
    byte buttonAction = btn & B11000000;
    if (buttonNumber == 1){
    button = LED_1;
    }
    if (buttonNumber == 2){
    button = LED_2;
    }
    if (buttonNumber == 3){
    button = LED_3;
    }
    if (buttonAction == BUTTON_PRESSED_IND){
    MFS.writeLeds(button, ON);
    MFS.write(buttonNumber);

    }
    else if (buttonAction == BUTTON_SHORT_RELEASE_IND)
    {
    MFS.writeLeds(button, OFF);
    MFS.write(OFF);
    }
    }
    }

    Thanks…

    Reply
    1. Kashif Baig Post author

      You can blank out the display by writing a blank string, or string of 4 spaces:

      MFS.write("");

      I hope that helps.

      Reply
      1. Wolfgang

        Hi Kashif !!

        Thank you very much!! It works as expected!!

        You are the machine!! 🙂

        Reply
  9. Christian T.

    I tried to make a loading bar and Found 2 Bugs:
    First
    MFS.write("....");
    causes a 3 time overwrite of the first point so that only one Decimal point is displayed. The same is happening with
    MFS.write("...");
    and
    MFS.write("..");
    of course.

    Now, it is possible to make the workaround with spaces in between, but them the second problem Kicks in:
    MFS.write(" . . . .");
    MFS.write(". . . . ");
    or
    MFS.write("r.r.r.r.");
    causes not displaying the last point of the four decimalpoints. Trying to workaround by using the rightJustify as follows
    MFS.write("r.r.r.r.",1);
    only moves the problem to the opposite side, because the mistake takes place before rightJustify gehts to work.

    For the first one I’ve made the workaround by changing the comparator from

    for (; *text != 0 && idx < sizeof(displayBuf); text++)

    to

    for (; *text != 0 && idx <= sizeof(displayBuf); text++)

    in MultiFuncShield.cpp forcing the last character to be read. Is that the fault of sizeof(), because it doesn’t want to count ending points, as part of the string?
    If there is something else than a point, it gets cut off anyway .. which is unclean .. but it works to solve the second bug.

    Reply
  10. Uten

    I have just received two cards from China that breaks this library!

    As I’m new to Arduino (and non of the samples found on the net worked ) I thought I had borked the card by short circuiting it against the usb terminal. But when I got the second card and it behaved the same way I figured something has changed in the hw.

    As I understand it the mapping SEGMENT_MAP_* in the code are found by calculating the off segments. On my cards I have to add the ON segments. So 255 – current_value should work (and it does) on my cards. So SEGMENT_MAP_DIGIT, SEGMENT_MAP_ALPHA has to be changed.

    SEGMENT_SELECT also have to be modified: The segment selection on my cards are SEGMENT_SELECT={0x7, 0xB, 0xD, 0xE}. Seems like any multiple of 16 can be added to those numbers. Not that I have tried them all.

    Turning off a segment (witch I think is hard coded as 255?) has to be modified, as 0 now is the SEGMENT_OFF number.

    The function AsciiToSegmentValue has to be changed according to the new “add on led segments” rule.

    So in MultiFuncShield.cpp change these lines:
    const byte SEGMENT_OFF=0; //Uten added this line

    const byte SEGMENT_MAP_DIGIT[] = {63,6,91,79,102,109,124,7,127,111};
    const byte SEGMENT_MAP_ALPHA[] = {119, 124, 94, 94, 121, 113, 111, 116, 48, 14, 173, 56, 173, 84, 92, 115, 103, 80, 109, 120, 28, 73, 73, 73, 110, 73};
    const byte SEGMENT_SELECT[] = {14,13,11,7};

    WriteValueToSegment(15,SEGMENT_OFF); //Turn all off //Uten: was 255

    displayBuf[idx] = SEGMENT_OFF; //Uten was 255

    for (; i_src >= 0 && displayBuf[i_src] == SEGMENT_OFF; i_src–) ; //Uten: was 255

    displayMemory[i_dst] = SEGMENT_OFF; //Uten: was 255

    WriteValueToSegment(displayIdx, SEGMENT_OFF); //Uten: was 255

    WriteValueToSegment(displayIdx == 0 ? 3 : displayIdx-1, SEGMENT_OFF); //Uten: was 255

    switch (ascii)
    {
    case ‘-‘:
    segmentValue = 64; //Uten was 191
    break;
    case ‘.’:
    segmentValue = 128; //Uten was 127
    break;
    case ‘_’:
    segmentValue = 8; //Uten was 247
    break;
    case ‘ ‘:
    segmentValue = SEGMENT_OFF; //Uten was 255
    break;
    }

    Thanks for a great library and tutorial

    Best regards
    Uten

    Reply
  11. Shashank

    Hi, my display shows inverse of what it should- the LED’s in the seven segment displays that should be ON are OFF and vice versa. I have made sure that none of the pins at the bottom are contacting. Apart from thinking that the manufacturer has sent a bad board. The piece has correct spellings.

    Reply
    1. Kashif Baig Post author

      Hi. I think you have the same issue as Uten (above). It seems there are shields that have been designed differently, see if you can incorporate his suggestions. Unfortunately, I don’t have these newer boards to test any code changes against.

      Reply
      1. Jan van Heck

        Hello Kashif,
        Yes I have the same problem and implement his suggestions in the MultiFunctionShield.cpp in my personal library.
        And now I have a 100% working situation. What I couldn’t make is a Conditional Compilation like you can do in the sketch with
        #define Common_Cathode
        and then
        #ifdef Common_Cathode
        here you will find the Common Cathode code
        #else
        and here the Common Anode code
        #endif
        Is there anyway a possibility to make a library with Conditional Compiling code options ?
        regards
        Jan

        Reply
        1. Kashif Baig Post author

          Hi Jan. In the library file MultiFuncShield.cpp there is a method WriteValueToSegment(). In fact there is a separate implementation for Uno, Leonardo and Mega2560. Perhaps you could apply a conditional XOR in this method? Is that what you’re looking for?

          Reply
        2. Jan van Heck

          In the aftermath of what Uten did if have made Conditional Compilation statements in MultiFuncShield.h and *.cpp files. Standard now configured for Common Cathode 4 digit 7 segment displays. The only thing you have to change instead you have the standard shield is comment out the #define Common_Cathode statement in MultiFuncShield.h file.
          Where can I have these both modified library files to ?

          Reply
          1. Jan van Heck

            After compilation of the Metronome sketch I see a warning error
            D:\Arduino\Shields\Multifunctioneel Shield\Metronome\Metronome.ino:11:1: warning: ‘typedef’ was ignored in this declaration
            };
            ^
            Sketch uses 8884 bytes (27%) of program storage space. Maximum is 32256 bytes.
            Global variables use 418 bytes (20%) of dynamic memory, leaving 1630 bytes for local variables. Maximum is 2048 bytes.

            Could I have to ignore it ?

          2. Kashif Baig Post author

            Although I don’t get this compiler warning, it should be OK to ignore.

          3. Kashif Baig Post author

            At the moment the library files are hosted on this website. If you have a blog or website that you can upload to, I’d be happy to link to it.

        3. Jan van Heck

          Hello Kashif,
          Sorry I only can give you my email address. No website, blog, twitter etc.

          Reply
  12. Jan van Heck

    Subject: Arduino Multi Function shield
    Dear Kashif Baig,

    First of all, I would like to thank you for your excellent documentation, electrical diagrams and example sketches of the Multi Function shield.

    But I also want to ask you for some help. By a local webstore I accidentally made notice of the Arduino shield. I like to use it during a Arduino beginners course of people who know absolutely nothing about the Arduino and how to program it. And because the price is so attractive, € 5.95, I’m going to work to get the students to buy this shield.

    I haven’t had any problem with most of the example sketches copied from the internet. Only those which where the 4 digit 7 segment display is used. While running, I see all segments light up but no readable numbers or characters appear.

    On the Internet I read, the 74HC595 shift register drives to these displays with “low” level signals. It is therefore the zeros in the byte that lightup the segments. In both shields I have this is not the case. After half a day experimenting, I found out that I had to convert both used segment arrays, (SEGMENT_MAP [] & SEGMENT_SELECT []) from Low level to High level active bytes. This was first done by me simply applying an XOR. And now I get readable numbers with the test sketches runs on both shields I have. Problem solved would you say.

    That’s partly true where it’s not that you’ve also made sketches that make use of a “MultiFuncShield” library. And my XOR trick does not go because I do not know how to apply this to a library. With reading and understanding how libraries works, I still have a lot of trouble with it.

    Could you probally help me with that?

    I think the problem is in the Display type used in the shields I bought. In both copies I have, and according to the website shop owner, this is the case in his whole entire party, the used type number HS420361K-A32, a 4 digit 7 segment display and this is a Common Cathode version.
    And I suspect that a Common Anode has been applied to the original shield.

    I have now use in my sketch a #define Common_Cathode command and I test this in the sketch of both arrays, with a #ifdef Common_Cathode if “True” than I use my customed Array’s and in the other case the original arrays. A simple test to make a conditional compilation.

    Is this kind of condition also possible to apply with a library from your sketch ? Then you don’t have to install and maintain two library versions when you have a shield with a Common_Anode or a Common_Cathode display build in the shield.

    I hope to hear from you soon.
    Kind regards Jan

    Reply
  13. Ugurhan Cakir

    Subject: Arduino Multi Function shield
    Dear Jan,
    To use HS420361K-A32 display
    MultiFuncShield.cpp in file:
    the original two lines for Uno :
    bitWrite(PORTB, 0, !!(Value & (1 << (7 – i))));
    and
    bitWrite(PORTB, 0, !!(SEGMENT_SELECT[Segment] & (1 << (7 – i))));

    change : bitWrite(PORTB, 0, !(Value & (1 << (7 – i))));
    and
    bitWrite(PORTB, 0, !(SEGMENT_SELECT[Segment] & (1 << (7 – i))));

    Similarly,  You must do the same in the other 2 boards ( Leonardo, Mega 2560 )

    Reply
    1. Raymond

      Hello,

      I have a 3461BS 7 segment display but its not working. Can you please help me on this

      Thanks

      Reply
      1. Uğurhan Çakır

        7 segment displays:
        3461BS common anode
        HS420361K-A32 common anode
        display’s pins connections are the same ( common anode ). If you do the same coding, it will work.

        Reply
  14. Jan van Heck

    Subject MultiFuncShield.cpp with Common Cathode 4 digit 7 segment display

    Hello Ugurhan
    YES it works too, but because I only own the Uno I have no possibilities for testing with the Leonardo or Mega 2560 hardware. But I trust that will work also. Thank you very much for your suggestions.

    // —————————————————————————————————-
    #if defined(__AVR_ATmega328P__) // Uno
    /* Write a value to one of the 4 digits of the display */
    void WriteValueToSegment(byte Segment, byte Value) {
    bitClear(PORTD, 4);

    #ifdef Common_Cathode // JJvH 4 Digit 7 Segment Display with Common Cathode display
    for (uint8_t i = 0; i < 8; i++) {
    bitWrite(PORTB, 0, !(Value & (1 << (7 – i)))); // Ugurhan Cakir
    bitSet(PORTD, 7);
    bitClear(PORTD, 7);
    }
    for (uint8_t i = 0; i < 8; i++) {
    bitWrite(PORTB, 0, !(SEGMENT_SELECT[Segment] & (1 << (7 – i)))); // Ugurhan Cakir
    bitSet(PORTD, 7);
    bitClear(PORTD, 7);
    }
    #else
    for (uint8_t i = 0; i < 8; i++) {
    bitWrite(PORTB, 0, !!(Value & (1 << (7 – i))));
    bitSet(PORTD, 7);
    bitClear(PORTD, 7);
    }
    for (uint8_t i = 0; i < 8; i++) {
    bitWrite(PORTB, 0, !!(SEGMENT_SELECT[Segment] & (1 << (7 – i))));
    bitSet(PORTD, 7);
    bitClear(PORTD, 7);
    }
    #endif

    bitSet(PORTD, 4);
    }
    // —————————————————————————————————-

    Add in MultiFuncShield.h
    #include "Arduino.h"
    #define ON 1
    #define OFF 0
    // comment if shield uses a 4 Digit 7 Segment Display with Common Anode display
    #define Common_Cathode // JJvH 4 Digit 7 Segment Display with Common Cathode display
    …..
    …..

    Reply
  15. David Hughes

    Hi. Thanks for making the library available. I tried it an it all worked. I have a question re the library. Where or how can I get the library API/declarations. I am not looking for the source code, just the function names and their definitions. I have looked in the keywords txt file. It lists the keywords but where can you see the headers with the data type requirements.?

    I bought the board on AliExpress for AU$2.17 including delivery and half expected it to be a dud. To my surprise, it works perfectly. Did you designed it?

    Cheers
    David
    Adelaide
    Australia

    Reply
    1. Kashif Baig Post author

      Hi David, I’m glad you find the library useful. You’ll find the necessary declarations in the file MultiFuncShield.h of the library.

      Did I design the shield? No, I can’t take credit for that. I came across it a few years ago when trying to find learning resources for the Arduino. Seeing that there were very few coding examples for it, I decided to develop a library.

      Many thanks
      Kashif

      Reply
      1. David Hughes

        Hi Kashif.
        Thanks for the quick reply, and a special thanks for writing the library. After I clicked send I figured out the definitions were in the .h files. The problem was that the Arduino development environment does not open .h files. I downloaded Notepad++ and found the declarations.
        I just started playing with Arduinos to teach my son a bit of computing and math. I have been in IT for decades but worked in a more formal environment where we had volumes written defining the interface to a library. I miss reading them but don’t miss writing them. I put together the sonar rangefinder and measured the ceiling height at 393cm and compared it with a Bosch laser device which said it was 3934mm . Not bad for a cheep Arduino. I am glad you didn’t design it because I bought mine on AliExpress for AU$2.17 including postage. How do they make them so cheep!! It would cost me more than that to post you a letter form Oz.

        Again. Thanks for the hard work and making it available.
        Regards
        David in Adelaide

        Reply
  16. Fred Page

    I have a multifunction shield from XINY. Using Arduino from Adafruit.
    MFS.initialize(&Timer1) in any code causes a constant buzz.
    Although the button shield and beeper shield do work with constant buzz.
    Any ideas?

    Reply
    1. Kashif Baig Post author

      Hi Fred

      I haven’t experienced a buzzing beeper before. The beeper is usually connected to digital pin 3, which is also a PWM pin, so it is possible there is a PWM signal being emitted from the pin. Perhaps use analogWrite() with different values to see if the pitch of the buzz changes. If so, then use a value which silences the buzz. I hope that helps.

      Kashif

      Reply
      1. Fred Page

        To silence my buzzer…. Your idea worked! I inserted “analogWrite(3,0)” after the MFS.initialize in your sample sketches. Buzzer is now silent.

        Reply
  17. Fred Page

    OK, It kind of worked. If any subsequent “beep” command is used the buzzer stays on. I can silence it after an appropriate “delay” command and then another “analogWrite”. Would if be possible to put the analogWrite inside the initialize and beep commands?
    An FYI… I purchased a second shield from same supplier. Same issue.
    Any guidance would be most appreciated.

    Reply
    1. Kashif Baig Post author

      Fred, have you tried using previous library versions? If not, download previous versions from here.

      Reply
    2. kriss

      hi fred ,i have your problem too plus my buzzer dont alarm and beep well in alarm mods cuz sound is very very low .can you help me with this? how can i give it enough volume to beep normal???
      some times i play with potensumeter ,can it cause this low sound level??
      help

      Reply
  18. Jan

    Hi Kashif Baig, tanks for the for great libary!
    I’ve found an bug in “MultiFuncShield.h” of version 1.2. The POT_IN ist defined as PIN 0
    #define MULTI_FUNCTION_SHIELD_LIB_1_2
    #define POT_PIN 0

    correct definition
    #define POT_PIN A0

    Jan

    Reply
    1. Fred

      POT_PIN is used with analogRead() in the sketches. analogRead(0) is equal to analogRead(A0), so this is no bug.

      Reply
  19. Seb

    Hi,

    great tool ! but…

    using the 7digit screen, except during initialization, I have all the first segment on on the 4 digits. any reason ? or idea ?

    Reply
    1. Kashif Baig Post author

      Hi, it could be the underside of the led display is making contact with the USB connector.

      Reply
  20. kriss

    hi im an electronic fan but my knowledge is low . plz give us the alarm clock ,count down and sonar ranger codes for the shields that have buzzer problem issue.my shield in any code causes a constant low buzz 🙁 that really drives me crazy -_- and when for example when i set the alarm for 12:01 (in alarm clock program )and its start alarming its sound is very very very low ,this situation goes for any other program too.
    1 of guys in upper replays said that (( I inserted “analogWrite(3,0)” after the MFS.initialize in your sample and the buzzer is silence))
    this thing works for me too but low level alarm sound problem still remain and after pressing button to ignore the alarm and constant low buzzing start again .. help me for gods sake 🙁
    (i think it must be something related to active and passive buzzers that ends up with analog things :|)!

    Reply
  21. Jerry

    Greetings! I have found your wonderful libraries for this shield very helpful. The only problem I have is that I am from a rather backward nation (USA) and we here have little idea what a meter is, let alone a cm. So it is, that the ghost detector I am designing for my niece who is really into this idiocy needs it to display inches, so she can see how close the ghost is to her (I never knew ghosts were solid enough to reflect a radio beam, however I guess one learns something new every day. Could you explain where i can put in a formula that will convert the cm to inches? This would be very helpful for my ghost hunting relative.

    Reply
    1. Kashif Baig Post author

      Hi Jerry, you would need to change the line of code where the distance is displayed:

      MFS.write(distance);

      Try dividing distance by 2.54:
      MFS.write((float)distance/2.54);

      I hope that helps.

      Reply
  22. IanF

    Hello Kashif,

    All works as expected. Just wanted to say thank you for all the excellent effort you put into this. It has helped my grandson and I as we navigate the Arduino experience together.

    You are a professional and giving person who have helped no doubt thousands of people get the most of from the multi function board.

    Thank you,

    IanF from Australia

    Reply
    1. Kashif Baig Post author

      Hi Ian, I’m glad both you and your grandson found these projects useful. I’m really keen to put together more projects, but at the moment I’m stuck with a never-ending backlog of other work. Who knows, things may change.

      Thanks,
      Kashif

      Reply
  23. Richard

    hi,

    Just starting with Arduino. Using Multi Function Shield. Tried the Shield Beeper exercise yesterday and everything worked fine. Tried the Detecting Button Press this morning and got an error message saying Multi Function Libraries was not found. Went back and tried the Shield Beeper exercise and got the same message. Checked code and it matches what is in your guide. as far as I can tell nothing else has changed from yesterday. any suggestions

    Reply
  24. Christopher P Herrick

    I have multifunction boards that have some of the 7 segment display pins stick out too far and contact the USB connector and one of the segments is blank as a result. Is it safe to trim the pins shorter or should I just cover the connector with tape?

    Reply
    1. Kashif Baig Post author

      Both methods work for me. An arduino with a different style usb connector is also an option.

      Reply
  25. Jae

    Hi,

    are there any connections on the shield? or you just load the code into the shield?

    Reply
  26. meg amano

    Hi!
    I’m looking for Arduino multi-function shield schematics design.

    Ihave plan to teach embeded computing with vor shield to ‘NON’ native English speakers.
    So they can’t recognize without schematcs.
    Tank you.

    Reply
  27. Robert

    Good day Everyone!
    Kashif Baig, thank you for sharing your resources and it is all working. May I ask, my LED display is showing extra line in all of the digit. Where can I edit the program from the library? And what code can I use? I’m new in coding and arduino. Please help me.

    Reply
    1. Kashif Baig Post author

      Hi Robert. It’s quite possible that the usb connector is touching the LED display pins from below. If that is the case, you can insulate the connector with some non-conducting tape.

      Reply
  28. Vladislav

    Hi!
    Can you help me with my problem? How can i output signs degree and Celsius.

    Reply
    1. Kashif Baig Post author

      Hello, unfortunately there isn’t support for degree symbol at the moment. But, you could add the change yourself by making changes to AsciiToSegmentValue() method in the library file (MultiFuncShield.cpp).

      Reply
  29. joepke

    I’m new in coding and arduino can you help me with a code for the multi function shield when I press button 1 that it then counts down 30 sec and counts down 60 sec at button 2 and 90 at button 3 thanks in advance

    Reply
  30. Danito

    I purchased the Multi Function Shield and downloaded the sketch for the 7 Segment displays. I want to change the behavior of the 7 segment display. For example I do not want the each LED to have a active segment in the upper right corner especially when I want the display to be 100 % blanked out. How can I see the code behind?

    Thanks,

    Dan C.

    Reply
    1. Kashif Baig Post author

      Hi Dan, this can happen when you have the soldered pins under the display in contact with the USB connector. If that is the case, you’ll need to use some insulation tape to prevent contact. Normally, writing an empty string blanks out all the segments.

      I hope that helps.

      Reply
  31. BN

    Hi, I’m new to Arduino so I may be missing something simple, but I keep getting a message saying
    Specified folder/zip file does not contain a valid library

    I have tried both the desktop and web editors and neither worked, I also tried the older versions and they didn’t work either.

    Any suggestions?

    Reply
  32. Reuel

    Kashif Baig,,
    Thanks very much for your MFC library. Everything works on my Freetronics Eleven (100% Uno compatible) but your library would not compile on my i586 Intel Gallileo (Gen1).
    Can you please let me where I can correct the dependancies on the AVR chips by MYSELF?
    Reason I ask is the Gallileo (though discontinued) is still useful as it already has (battery backed) RTC, LAN ,WIFI and SDCARD ready for Internet comunications and datalogging storage.

    Thank you
    Reuel

    Reply
    1. Kashif Baig Post author

      Hello Reuel. I guess anywhere in the library code that refers to AVR specific ports/registers will need to be migrated. First off is timer0 used for the 1khz interrupt. Other references are for reading and setting pin states.

      For the display, there should be a commented method in MultiFuncShield.cpp named WriteValueToSegment(), which I have reproduced below:


      void WriteValueToSegment(byte Segment, byte Value)
      {
      digitalWrite(LATCH_PIN,LOW);
      shiftOut(DATA_PIN, CLK_PIN, MSBFIRST, Value);
      shiftOut(DATA_PIN, CLK_PIN, MSBFIRST, SEGMENT_SELECT[Segment] );
      digitalWrite(LATCH_PIN,HIGH);
      }

      If you can get that working, perhaps in a loop to start with, that would be good progress.

      Reply
    1. Kashif Baig Post author

      Hi and thanks, will definitely take a look. Our library has also changed over time, and for example is no longer dependent on Timer1. Feel free to adapt your library accordingly.

      Kashif

      Reply
  33. DCL

    Thank you for all your work on this project.
    I recently secured one of these multifunction shields. It is a nice shield and all the example programs seem to function fine.

    I’m having an issue using it with the FastLED (or Adafruit_Neo_Pixel) library.
    The Arduino complier complains about Data_Pin 8

    ERROR:
    ( arduino-1.8.19\libraries\MultiFuncShield-Library/MultiFuncShield.h:22:23: error: expected ‘>’ before numeric constant #define DATA_PIN 8 )

    I assume there is a conflict with the “DATA_PIN” variable between the MFS and FastLED libs.
    I’m wondering if you have any experience with this, or have any suggestions to resolve the issue.
    Thank you for any assistance.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *