Multifunction shield for Arduino Uno (HCARDU0085)

bogd
Posts: 1
Joined: Wed Jul 16, 2014 8:05 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by bogd » Wed Jul 16, 2014 9:34 pm

@linker3000: one question from a newbie, if I may :)

The original DS18B20 code (posted by barewires above) includes a delay between conversion start and data read:

delay(1000); // maybe 750ms is enough, maybe not

However, that delay seems to be missing in your code. Could you explain (again, in terms a newbie could understand :) ) why it is not necessary?

Thank you!

linker3000
Posts: 5
Joined: Mon Jun 23, 2014 9:26 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by linker3000 » Thu Jul 17, 2014 6:54 pm

bogd wrote:@linker3000: one question from a newbie, if I may :)

The original DS18B20 code (posted by barewires above) includes a delay between conversion start and data read:

delay(1000); // maybe 750ms is enough, maybe not

However, that delay seems to be missing in your code. Could you explain (again, in terms a newbie could understand :) ) why it is not necessary?

Thank you!
Hi Bogd,

Actually, I grabbed my copy of tne code from elsewhere so it must have been altered by someone else! If the delay is essential for proper conversion I might be getting away with the fact that there's a 250mS delay between samples in my main loop.

Edit: I had a look at the data sheet for the DS18B20 and it states that the chip can take up to 750mS to generate the temperature data when it's operating at its default 12-bit resolution. This is probably why there's the delay you spotted in the example code. To play nice with the chip I have added the delay back in to my example. I have also altered the delay in the main loop to 4 seconds, so, overall, the temperature on the display will update roughly every 5 seconds. Thanks for spotting that.

Edit2: 18-July-2014: I was looking at the code again and realised that due to the 4 x 10mS delays in the LED display interrupt routine, and the fact that it's called around 200 times a second, this was adding up to a significant time pause in its own right so I have modified the delay value in the main loop to account for this and provide an overall display update approx every 10 seconds. Published code has been updated accordingly.

vladtheimpatient
Posts: 2
Joined: Thu Aug 14, 2014 11:27 am

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by vladtheimpatient » Fri Aug 15, 2014 2:40 pm

Hi,

I am having problems lighting more than on 7 segment at the same time.

I follow the code example given, ported to mbed.org and ST NUCLEO-L152RE, but setting subsequent 7 segment digits clears the previous one so I only ever have one lit up. Or rather, if I OR the segment select masks I can have the last value displayed on more than one segment at a time, but not different values for different segments.

The code I'm using is essentially:

Code: Select all

_latch = 0;
for (int i=7;i>=0;i--) {    // bValue is the digit mask to display
    _clock = 0;
    _data = (bValue & (1<<i));
    _clock = 1;
}
for (int i=7;i>=0;i--) {    // bSegment is the segment select mask
    _clock = 0;
    _data = (bValue & (1<<i));
    _clock = 1;
}
_latch = 1;
Repeating this with different bSegment and bValue clears the previously set segment.

Any ideas?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by andrew » Fri Aug 15, 2014 4:13 pm

You have to write to each segment in sequence in a continuous loop. Notice in the example sketch the function that writes to all 4 digital is being continuously called by the function WriteNumber(). If you do it fast enough it creates a persistence of vision (POV) effect and they all appear to be on at the same time. Btw in the code you have posted you have bValue instead of bSegment.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

vladtheimpatient
Posts: 2
Joined: Thu Aug 14, 2014 11:27 am

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by vladtheimpatient » Mon Aug 18, 2014 7:45 am

andrew wrote:You have to write to each segment in sequence in a continuous loop. Notice in the example sketch the function that writes to all 4 digital is being continuously called by the function WriteNumber(). If you do it fast enough it creates a persistence of vision (POV) effect and they all appear to be on at the same time. Btw in the code you have posted you have bValue instead of bSegment.
Thanks! I suspected (feared?) as much. :)

No matter, this is only for test and fooling around. I can live with that.

And you're right about the second code segment. Copy/paste error. I didn't paste my actual code just a sketch built from copy/pasting it. :D

timgtech
Posts: 4
Joined: Sun Sep 07, 2014 11:49 pm
Location: Sarasota, FL, USA

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by timgtech » Mon Sep 08, 2014 12:15 am

What about example code for using wireless, bt, or voice recognition module? Anything available for that?
Also, I assume those 12 pins are for servos? Any examples for those? What are jumpers J1 and J2?
Do you sell any of these modules I could use with this board and / or could you point me to some that would work?

Sorry If I am asking too many questions at once. I am kind of new to Arduino. New to the forum to so my apologies if I posted this in the wrong spot.

Thanks!! :P

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by andrew » Mon Sep 08, 2014 8:06 am

What about example code for using wireless, bt, or voice recognition module? Anything available for that?
That interface is connected directly to the Arduino's hardware serial port and is just arranged in a convenient way for connecting a Bluetooth/APC220/Voice module to it. You can treat it in the same way as the serial port on your Arduino board. For the Bluetooth module, as it is just acts as a dumb serial pass-through device, it doesn't require any code to use it. You can just use any sketch that makes use the hardware serial port and so long as the board rate is correct it should work fine. You can find more information on how the
Bluetooth devices work in this thread:

http://forum.hobbycomponents.com/viewtopic.php?f=74&t=9
Also, I assume those 12 pins are for servos?
That is correct. You can of course use them for other purposes but they are arranged for connecting servo's to them. The 5V power is taken directly from the Arduino's 5V supply.
Do you sell any of these modules I could use with this board and / or could you point me to some that would work?
We do sell Bluetooth slave modules that can be used with this port. The link below is to our HC-06 slave module which will pair with Bluetooth master devices such as computers, tablets, and smart phones:

http://hobbycomponents.com/index.php/ar ... odule.html

For the voice recognition module, we do currently have a suitable one but it is awaiting evaluation before we can place it on sale.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

timgtech
Posts: 4
Joined: Sun Sep 07, 2014 11:49 pm
Location: Sarasota, FL, USA

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by timgtech » Thu Sep 11, 2014 1:44 am

Andrew - thank you for the information. That makes sense and helps a lot. I will keep my eye open for the voice recognition module.

Thanks again!! :)
"Just call me AND OR NOR. But never NAND."

richard
Posts: 1
Joined: Sun Sep 07, 2014 3:23 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by richard » Sun Sep 14, 2014 3:46 pm

Hello
im' french, excuse me for my bad english.
i became last week the module wuth the 4 digits, but when i upolad the sketch in the arduino to display an interger of the digit they can't display the number "5" et the number "6"n the replace it with "9" ant "8" !! can someone help me ????

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Sun Sep 14, 2014 4:09 pm

richard wrote:Hello
im' french, excuse me for my bad english.
i became last week the module wuth the 4 digits, but when i upolad the sketch in the arduino to display an interger of the digit they can't display the number "5" et the number "6"n the replace it with "9" ant "8" !! can someone help me ????
Pull the shield slightly out of the sockets or place some insulation between the USB housing and the PCB of the shield. It may be the display pins shorting out on the USB housing like it did on mine.

Post Reply

Return to “Arduino Shields”