Show Posts
Pages: 1 ... 41 42 [43] 44 45 ... 67
631  Using Arduino / Project Guidance / Re: memory on: December 08, 2012, 09:09:54 am
Share your code here, along with a careful description of what you're trying to do and what you've tried; it's possible there's a simple change that can save enough space to get you going again, and then again it's possible we can establish that your problem is too big to fit an arduino.

-br
632  Using Arduino / Project Guidance / Re: New but searching for help on: December 08, 2012, 09:04:57 am
You're welcome.  Yes, any basic arduino set should do.  In fact, most Arduino sets will come with the LEDs, the resistors, and a buzzer or two, and a breadboard to wire everything up on.  I should have mentioned the breadboard.  Solderless breadboards make experimenting very easy.  Oh, and some jumper wires...

The shield kit requires soldering to assemble, so it's a project with a skills learning project built in.  Not to mention budget for a soldering iron. 

It would be worth cutting your teeth on a smaller learn-to-solder project first because it's not uncommon to damage your first board a little bit while you're getting the hang of it.  Maybe something like this: https://www.sparkfun.com/products/10546

-br
633  Using Arduino / Project Guidance / Re: New but searching for help on: December 08, 2012, 08:41:39 am
Two leds and two resistors between 220 and 1000 ohms for the lights.

Adafruit shield for realistic .mp3 sound effects: https://www.adafruit.com/products/94

Your schedule is realistic for someone who has all the parts on hand and has done it before.  For a newbie, the arduino and lights would be a good weekend project.  Add the sound effects later.  (You can do primitive sound effects with a "piezo beeper" and another resistor.  Search the forums.)

Quality, features, date.  Pick two.

-br
634  Using Arduino / Programming Questions / Re: Serial.print error on: December 08, 2012, 07:49:01 am
Putting Serial.write first won't matter -- because the output you send to Serial.write is buffered.  When you Serial.write, it buffers your output (presuming there's room) and starts up an interrupt-driven activity to print your output from the buffer, then returns to you immediately.  

So the hypothess is that your relay is firing during the printing, in the error case, causing the glitch.  The fact that it's just a few characters (=milliseconds) into the string is the giveaway.

You could use Serial.flush() to force all the characters to be transmitted before you turn the relay on, but the glitch is telling you your power suppy is not adequate or not adequately decoupled, and you should fix it properly or you will just be facing it in another form shortly down the road.

This is probably a good time to ask if you have the relay connected directly to the Arduino output pin, which is not usually a good idea because relays use too much power and cause glitches like this or worse (like frying your board).  

-br




635  Using Arduino / Programming Questions / Re: Serial.print error on: December 08, 2012, 07:24:19 am
The problem is the serial output glitch, right? 

I wonder if turning on the relay is glitching the power supply and causing the serial output to take a hit.


-br

636  Using Arduino / Programming Questions / Re: Please Help-IR TX RX on: December 08, 2012, 07:22:21 am
Victory!  Now, as for your questions:

Quote
Another question is, can I not use the char letters from the ir transmitter code but instead of just showing the dots and dashes say something like ".-" = "a" and then print the string to the serial monitor.
Sure.  That's what I meant by comparing the captured dit-dah pattern to your table.

Quote
A separate question I have found links on dits and dahs and the code to receive. Can I apply this to dots and dashes I used in the IR TX code. For example in the codes I have found they specify dits and dahs can I change them for dots and dashes or does it matter. The only reason I ask this is because I have not referenced dits and dahs on the IR TX code.
Dit and Dah are just amateur radio lingo for dot and dash.  You can call them what you like.  We use them because mastery requires learning the sounds of the letters: we learn R as didahdit, which it actually sounds like, not dotdashdot.  Y is dadidada.  And so on. You learn the code faster thinking in sounds instead of visual dots and dashes. But for your program it's up to you what to call them.

-br
637  Using Arduino / Project Guidance / Re: Maximize buzzer loudness on: December 07, 2012, 06:42:02 pm
May I bark up a different tree for a moment?

A common complaint here on the forum is that "my LEDs are very dim", and the problem is usually resolved by calling pinMode(pin, OUTPUT); - supplying the forgotten initializer.  Inputs make very weak outputs.

I haven't seen any code yet, so I have to ask: can we verify that this is not the problem in this case? 


-br
638  Using Arduino / Project Guidance / Re: Arduino+Linksys+internet to set and get Arduino variables over the internet on: December 07, 2012, 05:36:20 pm
You might benefit from some ideas in Bitlash Communicator:

https://github.com/billroy/bitlash-commander

I don't think it's a direct drop-in for your problem, but the combination of Bitlash as the client program (or anything speaking the same prompt-delimited protocol), speaking over USB to a server that provides a web interface / control panel sounds like it's in the neighborhood.

Good luck with your project,

-br

639  Using Arduino / Motors, Mechanics, and Power / Re: Digital power switch? on: December 07, 2012, 10:30:19 am
The contacts are rated for 5 Amps.  Exceeding that means you've got no thermal safety margin.  At 12 volts, 5 Amps is 60 watts.

You could squeeze more power through the contacts at a higher voltage, but my understanding is that the load wants 12 volts in this case.

Fortune favors those who design circuits with wide safety margins.

-br
640  Using Arduino / Motors, Mechanics, and Power / Re: Digital power switch? on: December 07, 2012, 09:51:46 am
That relay is rated for 5 Amps, which at 12 Volts means it can switch a 60 Watt load (12 x 5) with zero margin.  I'm guessing your TV needs more than 60 Watts, but you can check on the nameplate.  It may even say how much current it needs.  Fortune favors those who operate with safety margins.

So probably not, but a similar relay with a higher current rating would be a good candidate.

Connecting a relay to a digital output pin requires a transistor, a base resistor for the transistor, and a flyback diode.  If you search the forum there are plenty of examples.

-br



641  Using Arduino / Programming Questions / Re: Please Help-IR TX RX on: December 07, 2012, 08:07:21 am
That code looks great.  Nice work.

Quote
what i have found now is that if i take a wire from the breadboard and put it to 5v on the reciever the serial monitor goes mad with the text "Receieved". Would this mean i have wired up incorrectly?
I am puzzled now, too.  Take a wire from where to where?  If what you are saying is that when putting +5V (also known as HIGH) into the receive pin, the receiver prints Received, isn't that victory?

Another way to test the receive code is to use an IR remote control as the transmit side...
 
-br
642  Using Arduino / Programming Questions / Re: Please Help-IR TX RX on: December 07, 2012, 07:10:58 am
Interesting project.  Here are some thoughts:

1. This code isn't happy:
Code:
 digitalRead(receiver, LOW);
}
  if (receiver, HIGH)

Correct code for digital read is:
Code:
  value = digitalRead(pin);
Correct code for testing for equality in an if statement is:
Code:
if (value == HIGH)
So this code needs tweaking to do what you want.  Read the pin's state into a value variable (which you'll need to declare) and test that value in the if.  Make it look exactly like the syntax in the examples.  You can keep a few examples open for reference as you code.

2. Once you can prove you're getting a receive stream, you can move on to matching morse.  The basic idea is to capture the dit-dah pattern while waiting for a silent inter-character interval, then compare the captured dit-dah pattern to each item in the table you use to transmit morse until you find a pattern that matches.  The character that owns that pattern is the character you process as received.

This is best done by organizing your code as a 'state machine', search for it, you'll find lots of examples, then write your own.

When I was a kid, I read a book about AI that talked about receiving Morse as an AI-class project.  Now we do it on our Arduinos.

Good luck with your project.

-br

Edit: Here's some code that does Morse send and receive.  It's torn out of a project, so it would need tweaking to work, but it might give you some ideas: https://github.com/billroy/bitlash/blob/master/examples/morse2/doc/morseio.c
 -- for your project you'd pretend the receiving IR was the keyer input.

643  Using Arduino / Motors, Mechanics, and Power / Re: Digital power switch? on: December 07, 2012, 06:48:32 am
No offense taken, sir.  Your advice was valid but a little incomplete on the safety side smiley-wink

Best regards,

-br
644  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Randomly Freezing During Long Jobs on: December 07, 2012, 06:36:10 am
This is an interesting bug.  It smells like a memory leak or corruption crash to me.  From the other thread, it appears you were using Strings - no longer, right?

To detect a possible leak, it might be worth instrumenting how much RAM is free and printing that out every half hour.  There is a magic function for calculating free ram if you search the forums.

Memory corruption is more likely than memory exhaustion if you have stopped using Strings.  I would Serial.print() the living devil out of the code path between finishing the command successfully and printing OK.  You know it falls off the rails in there somewhere.  One Serial.print per line if that's what it takes.  (Or binary search, if you have a lot of 8-hour test windows…)  If you can figure out which line it fails on, it might help.


-br

645  Using Arduino / Motors, Mechanics, and Power / Re: Digital power switch? on: December 07, 2012, 06:25:50 am
The relay idea will of course work -- it's what's in the product I pointed to -- but I wouldn't recommend running live 110volt AC power on any board to a newbie to electronics.  The cost of small mistakes is too high.  Too much possibility of getting hurt.

-br
 
Pages: 1 ... 41 42 [43] 44 45 ... 67