Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Multifunction shield for Arduino Uno (HCARDU0085) 
Author Message

Joined: Wed Jul 16, 2014 8:05 pm
Posts: 1
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
@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!


Wed Jul 16, 2014 9:34 pm
Profile

Joined: Mon Jun 23, 2014 9:26 pm
Posts: 4
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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.


Thu Jul 17, 2014 6:54 pm
Profile

Joined: Thu Aug 14, 2014 11:27 am
Posts: 2
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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:
_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?


Fri Aug 15, 2014 2:40 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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.


Fri Aug 15, 2014 4:13 pm
Profile

Joined: Thu Aug 14, 2014 11:27 am
Posts: 2
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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


Mon Aug 18, 2014 7:45 am
Profile

Joined: Sun Sep 07, 2014 11:49 pm
Posts: 4
Location: Sarasota, FL, USA
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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


Mon Sep 08, 2014 12:15 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
Quote:
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:

viewtopic.php?f=74&t=9

Quote:
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.

Quote:
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.


Mon Sep 08, 2014 8:06 am
Profile

Joined: Sun Sep 07, 2014 11:49 pm
Posts: 4
Location: Sarasota, FL, USA
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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."


Thu Sep 11, 2014 1:44 am
Profile

Joined: Sun Sep 07, 2014 3:23 pm
Posts: 1
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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 ????


Sun Sep 14, 2014 3:46 pm
Profile

Joined: Thu Mar 13, 2014 12:46 pm
Posts: 25
Post Re: Multifunction shield for Arduino Uno (HCARDU0085)
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.


Sun Sep 14, 2014 4:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 50 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD