Help with Multi Function Shield

Hi All,

I am just trying this out and having an issue with the Multi Function Shield, I have copied a tutorial to make a countdown timer using the following code and the top right corner of each segment remains permanently lit up, which makes reading the numbers difficult, can anyone help?

#include <TimerOne.h>
#include <Wire.h>
#include <MultiFuncShield.h>
 
 
enum CountDownModeValues
{
COUNTING_STOPPED,
COUNTING
};

byte countDownMode = COUNTING_STOPPED;
 
byte tenths = 0;
char seconds = 0;
char minutes = 0;
 
void setup() {
// put your setup code here, to run once:
Timer1.initialize();
MFS.initialize(&Timer1); // initialize multifunction shield library
MFS.write(0);
 
Serial.begin(9600);
}
 
 
void loop() {
// put your main code here, to run repeatedly:
 
byte btn = MFS.getButton();
 
switch (countDownMode)
{
case COUNTING_STOPPED:
if (btn == BUTTON_1_SHORT_RELEASE && (minutes + seconds) > 0)
{
// start the timer
countDownMode = COUNTING;
}
else if (btn == BUTTON_1_LONG_PRESSED)
{
// reset the timer
tenths = 0;
seconds = 0;
minutes = 0;
MFS.write(minutes*100 + seconds);
}
else if (btn == BUTTON_2_PRESSED || btn == BUTTON_2_LONG_PRESSED)
{
minutes++;
if (minutes > 60)
{
minutes = 0;
}
MFS.write(minutes*100 + seconds);
}
else if (btn == BUTTON_3_PRESSED || btn == BUTTON_3_LONG_PRESSED)
{
seconds += 10;
if (seconds >= 60)
{
seconds = 0;
}
MFS.write(minutes*100 + seconds);
}
break;
 
case COUNTING:
if (btn == BUTTON_1_SHORT_RELEASE || btn == BUTTON_1_LONG_RELEASE)
{
// stop the timer
countDownMode = COUNTING_STOPPED;
}
else
{
// continue counting down
tenths++;
 
if (tenths == 10)
{
tenths = 0;
seconds--;
 
if (seconds < 0 && minutes > 0)
{
seconds = 59;
minutes--;
}
 
if (minutes == 0 && seconds == 0)
{
// timer has reached 0, so sound the alarm
MFS.beep(50, 50, 3); // beep 3 times, 500 milliseconds on / 500 off
countDownMode = COUNTING_STOPPED;
}
 
MFS.write(minutes*100 + seconds);
}
delay(100);
}
break;
}
}

I'm not familiar with any of this, but it appears that the display is controlled entirely within the library. Assuming the code is kosher and as found, this suggests there is a problem with the shield.
Look for solder bridges around the display.

Yep I think I see it, it is the third pin on the unit to the right. That is about an accurate answer you can get with the information given. What board, what shield, how is it wired, how is it powered all helps. A annotated schematic whould have all of this information except the links to the hardware items technical information you need to supply.

Hi, @rikkstar
Welcome to the forum.

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

Thanks Nick! This helped me solve the problem, I had connected the Shield onto the top of the Arduino and two of the pins were both touching the usb port so have separated it slightly and it works perfectly! Thanks for your help!

some boards have those pins clipped. a piece of tape may also be needed

Oh Gawd, I've seen that before. I used a piece of credit card on the socket. Every project since has had an ethernet shield as the first storey, for only two good reasons - the bullet-proof SD card slot, and the extra long pins....

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.