Show Posts
Pages: 1 ... 53 54 [55] 56 57 ... 269
811  Using Arduino / Project Guidance / Re: Barcode reader on: February 10, 2014, 10:50:58 pm
image recognition is definitely not a requirement

Yes it is. You need to recognise the barcode against its background in the first place, and fence it. Then you need to decode the stripes into, well, stripes. Then you need to decode the stripes into characters. That involves testing the start characters against a number of possibilities so you know what the symbology is (unless you know they will all be of one symbology.)

Then, assuming it's an EAN product style code, you need to look at the first character (eg the "6" which for me indicates South Africa- not that the country is important) which actually is significant since it explains how to decode the pattern. (The "left" and "right" sides of the barcode are encoded differently.)

If it's a barcode that actually contains data (as opposed to merely the number) like EAN-128 then there's a shit house full of further decoding to do, including check digits and the like.

It's not a trivial task. Faaaaar easier to get a gun to do all that and spit out the number....
812  Using Arduino / Project Guidance / Re: Barcode reader on: February 10, 2014, 10:31:59 pm
I think a proper bar-code gun reader thingy has to be the way to go: the recognition intelligence is built-in, and all it does is send out a number. It decodes the bar-code, most even recognising one symbology from another, strips out crap like start and end guards, knows about check-digits etc etc. All you get out is the number.

Then have a processor do something with that number, like log an item in or out, and keep a record of quantity and so on.

But how you hook one of those guns to an Arduino I have no idea, and would love to know. I imagine they're largely usb....

EDIT: Jimmyyy's software solution is cool, but it's a .net thing and to provide that functionality in an Arduino? I found a similar thing years ago- just a standalone utility it was- which decoded an image (jpeg, tiff etc) of a barcode into the codes. In fact even a dozen codes of different symbologies and at random orientations could be decoded from one pic. But that's pretty intensive processing I think.
813  Using Arduino / Programming Questions / Re: Arduino Led and sensor on: February 10, 2014, 10:08:19 pm
I don't know what you mean when you say you want to "control" an HC-SR04. But its measurement is kicked-off by you sending it a pulse, so if that's what you mean by control, then yes you can.

To disable a PIR I guess you could power it from the 5V of an i/o line rather than the Arduino 5V, and so disable it by setting that pin low and turning the PIR off. Check the PIR datasheet for current consumption.
814  Using Arduino / Programming Questions / Re: Arduino Led and sensor on: February 10, 2014, 02:23:11 pm
I don't think you can adjust those characteristics in code- almost certain they are hardware related.

If you haven't seen it before, Adafruit has a very good tutorial, which is where my code above came from.
815  Using Arduino / General Electronics / Re: Interrupt problems on: February 10, 2014, 12:24:00 pm
Wire up like this, add indicated line:

@CR....  And change the interrupt to FALLING? That seems to go with the pullup / active low idea?
816  Using Arduino / General Electronics / Re: Interrupt problems on: February 10, 2014, 12:14:40 pm
Ok, I didn't follow the horizontal / top-left stuff too well without a pic, but you might like to double check you have the switch oriented correctly. It might work if you turn it 90 degrees. The attached pic shows how those 4-legged  things are typically made: see the ppart of the pic that shows the internal connections.

If you have an ohm- meter it would be a good idea to verify how yours works....
817  Using Arduino / Programming Questions / Re: Servo rotation help on: February 10, 2014, 11:38:12 am
Quote
the INPUT_PULLUP parameter for setMode()

Or even for pinMode 

818  Using Arduino / Programming Questions / Re: 4 buttons on Analog 0 with wave shield on: February 10, 2014, 07:33:02 am
Need a sort of "play without delay" kind of thing  smiley-razz
819  Using Arduino / Programming Questions / Re: 2 leds in the same time on: February 10, 2014, 07:30:14 am
Ah, that's easy, its a hardware problem:

Connect one LED and its series resistor between the pin and GND,
connect the other and its series resistor between the pin and Vcc.

.... making sure the flat side of the LED faces the right way  smiley-razz
820  Using Arduino / Programming Questions / Re: 2 leds in the same time on: February 10, 2014, 07:22:34 am
Ah crap, sorry...

Code:
if (digitalRead(LED1) == HIGH) digitalWrite(LED2, LOW);
if (digitalRead(LED1) == LOW) digitalWrite(LED2, HIGH);
821  Using Arduino / Programming Questions / Re: 2 leds in the same time on: February 10, 2014, 07:12:07 am
How about:

Code:
if (LED1 == HIGH) digitalWrite(LED2, LOW);
if (LED1 == LOW) digitalWrite(LED2, HIGH);


822  Using Arduino / Programming Questions / Re: RTC DS1307 on: February 10, 2014, 06:08:03 am
As PaulS has said what you want to do depends on the library you have used. I've dabbled in that with a DS1302 not a 1307, using Henning Karlsen's library.

There, you define a structure say t as Time.

Code:
Time t;

Then later you can read the current time into that structure:

Code:
t = rtc.getTime();

Then, you can compare the variable/s of the structure to your target time, say when the hour is 6:

Code:
if t.hour == 6
{
//..... etc etc

You might need to have a flag to prevent you feeding a zillion times thru loop() since hour will be 6 for many many many passes.

Each time thru check the fed flag. First time through set the fed flag, and next time it's checked and found true, don't feed again, as long as hour is still 6.

First time the hour isn't 6, clear the fed flag so that it's ready for the next feeding time.

There may well be more elegant ways, but that worked for me.

And as I said it's based on Henning's 1302 library.... YMWV.

Have a look here

EDIT... I had s quick look at the manual for his 1307 library and it looks as if it has the same approach. So the above should work. Don't quote me  smiley-cool
823  Using Arduino / Programming Questions / Re: help how to calibrate lm35 digitally via software to read accurately on: February 10, 2014, 04:50:30 am
Here's an interesting journal article.

Pity it's silent on the accuracy of the LM35 and seems more interested in the communications aspects, which is the author's field of study. Seems the patient just grabs the LM35 between his or her fingers.....
824  Using Arduino / General Electronics / Re: (Solved! ..Software Solution) How to prevent Output pins floating on boot on: February 10, 2014, 04:43:07 am
No hard wired pulldown resistor required.

Why do people keep saying it is

If that's aimed at me, I didn't say it. I'm confused that your solution works and I'm just wondering why.

825  Using Arduino / General Electronics / Re: (Solved! ..Software Solution) How to prevent Output pins floating on boot on: February 10, 2014, 04:06:13 am
I haven't followed this in detail but it confuses me: since the relay pin being high is the problem, how can pulling the pin high make the problem go away. The hardwired pull-DOWN solution seems more logical to me.....

But then I'm not an electrical engineer either  smiley-cool just a simple mud-mechanic.
Pages: 1 ... 53 54 [55] 56 57 ... 269