Show Posts
Pages: 1 ... 28 29 [30] 31 32 ... 37
436  Using Arduino / Programming Questions / Re: Two newbie questions: status and printing a boolean on: November 10, 2011, 01:37:31 am
Oh I get it now...the IDE reads all the libraries keywords.txt on startup, not just when you #include a library. I changed 'status' to 'stptus' in the Ethernet keywords.txt and restarted the IDE and you're right it wasn't highlighted.

Good to know. Thanks!


437  Using Arduino / Programming Questions / Re: Two newbie questions: status and printing a boolean on: November 10, 2011, 01:28:32 am
'status' gets highlighted even in this basic code:

Code:
void setup(void) {
  int status = 9;
}

void loop(void) {
}

but it compiles with no problems.

I didn't see 'status' in lib/keywords.txt so my guess is you're right, it's a holdover.
438  Using Arduino / Programming Questions / Re: Two newbie questions: status and printing a boolean on: November 09, 2011, 11:20:45 pm
I'm not sure about status...will check and get back to you.

Regarding your print statement, by default serial.print() will try to print one byte data as ASCII. Something is actually coming out, but it's ASCII 0 which is probably not what you want. You can force the output to be numeric like this:

Serial.print(state, DEC);

See http://www.arduino.cc/en/Serial/Print

for more details.

Good luck!
439  Using Arduino / General Electronics / Eagle library for AD5206 six digital pot (TSSOP) ? on: November 08, 2011, 03:21:40 pm
Does anyone have a library for the Analog Devices AD5206 six digital pot with a TSSOP footprint? I've found libraries for the TSSOP AD5204 (quad pot) and the DIP AD5206, but not the one I'm looking for (part # AD5206BRUZ10).

Thanks!
440  Using Arduino / LEDs and Multiplexing / Re: Question concerning LED matrix using TLC5490 and arduino on: November 07, 2011, 11:37:52 pm
It's 120 mA per pin, but that's the absolute max. As far as how much total current the chip can handle, see the data sheet under "dissipation ratings" for the type of chip you're using. Divide the milliwatt rating by the voltage you're using for your max.

Good luck!

441  Using Arduino / Programming Questions / Re: Range as Variable? on: November 07, 2011, 11:24:54 pm
It sounds like your problem is similar to putting multiple buttons on one analog pin. Here's an example of doing that; you should be able to base your code on this without too much trouble.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1267115381

Good luck!
442  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet IP address through router? on: November 07, 2011, 10:28:41 pm
You're correct, use something in 192.168.0.x. The 18.250.7.131 is your router's outside (public) address.

If you can't get it working let us know the subnet mask, router (gateway) address,and what address you're trying to use.

443  Using Arduino / LEDs and Multiplexing / Re: Hot to diffuse Multicolour LED? on: November 07, 2011, 04:31:49 pm
Sandpaper (skuff up the plastic housing), straws (cut off a small piece and cover the housing), ping pong balls (put the LED inside), and styrofoam (shape a small piece and put the LED inside) can all work.

I have personally had pretty good success with sandpaper.

Chris
444  Community / Exhibition / Gallery / Re: Almost done with my 24x16 LED project on: November 07, 2011, 01:08:39 am
Thanks! It's still very much a work in progress so I don't have any Eagle schematic files to share yet. But here's some details and attached is a picture of the breadboard.

My test LED board is a grid of 24 x 16 1206 SMD LEDs. I hand soldered this one, I wanted to try toaster oven reflow soldering but wasn't sure about temperature variation in a cheap toaster oven with a board that big (it's 8" x 6"). The next one will be 8 boards of 3 x 16 LEDs, arranged in an octagon, and hopefully they'll work in an oven because hand soldering 384 SMD LEDs is not as much fun as it sounds....

I got a blank ATMega328 (second left chip from bottom in the pic), added the crystals, caps, and resistor, then programmed it with OptiLoader through my Duemilanove.

I added a FT232RL (bottom left chip) and an old USB cable so I could program it without the Duemilanove. The USB side of the chip is wired like the "Self Powered Configuration" schematic in the data sheet and the serial side is just like Duemilanove schematic (1K resistor between FT232RL and ATMega328's TX and RX pins, .1 uf cap between FT232RL DTR and ATMega328 Reset, and LEDs with 1K resistors on FT232RL CBUS0 and CBUS1 pins for the indicator LEDs).

At the bottom right is a DS1307 clock chip and its crystal and battery.. I know the clock works by testing it with the serial port, but haven't written anything to display the time on the LEDs yet.

The top left chip on the bottom board is an AD5204 quad digital pot connected to the ATMega328 via SPI. You use a resistor on a TLC5916 to control current to the LEDs so this lets me adjust their brightness. You can't see it in the picture but I've got a photoresistor on an analog port on the front; my goal is to have overall system brightness depend on how bright the room is (so the display can be seen in the day, but doesn't blind you in a dark room). I am still evaluating this chip...at full load (around 180 ohms) the TLC5916s draw 11mA through their resistors. The spec sheet for the AD504 says the max current per pot is 20mA but it also says you shouldn't have a sustained load of more than 5.6mA per pot...so I don't know if I should keep it or not. I'm considering swapping it with a AD5206 (six digital pots) and running two digital pots in parallel to each TLC5916.

On the bottom left of the top breadboard is 3 TLC5916s, also connected to the ATMega328 via SPI, with one additional pin for Output Enable. The 3 chips are daisy chained with SDO from the first to SDI on the second etc. The 24 outputs from the 3 chips go to the cathodes of the LED grid.

To the right of them are 2 74AC138s wired to be a 4:16 decoder. Each of the 16 outputs goes to the gate of a logic level P channel MOSFET. So 4 pins from the ATMega328 select which of the 16 MOSFETs is on.

The 16 MOSFETs are SOT-23 SMD parts and the top rows of little green boards are their breakouts. As you have probably guessed, my eventual goal is to use all SMD parts on the final circuit board.

Also at the top right is a 220 uf capacitor. I have .1 uf caps across the power lines of all the chips but the circuit still locked up or wouldn't boot once in a while until I added it. My guess is I have a cheap power supply, but it's the only one I had that could provide more than 2 amps.

I'm currently switching rows at 25 KHz, which is enough to give 8 levels of PWM. I haven't had good success getting 16 levels of PWM yet but haven't spent much time on it either.

With a switching rate of 25 Khz each row is only on for 0.04ms, short enough to overdrive the LEDs. 180 ohms to the TLC5916s R-EXT pins should provide 100mA to each LED and the MOSFETs can handle the 2.4A all 24 LEDs would take. In practice, however, my meter says the total circuit draw never exceeds 2 amps so my guess is the short pulses limit maximum current...either that or I'm missing something, but don't have anything like an oscilloscope to test.

As far as code I've got the basic setpixel etc. routines going, but it's mostly hacked together and needs a clean rewrite. That is what I will be doing for evenings for the next few weeks...or months...

Chris
445  Using Arduino / Project Guidance / Re: The Arduino Editor on: November 05, 2011, 01:01:31 am
I gave up on trying to live with the weak editor in the IDE and now use Notepad2 set to C highlighting syntax, and am much much much happier coding.
446  Community / Exhibition / Gallery / Almost done with my 24x16 LED project on: November 05, 2011, 12:49:35 am
I'm almost done with the hardware for my latest project and needed to test out brightness, current load, and button routines and I thought hey, why not film it:



There's an ATMega328 driving a grid of 24x16 LEDs. The columns are controlled by 3 TLC5916s and the rows by 2 74ac138s and 16 p-channel MOSFETs. I'm still using a Duemilanove board for USB to my computer but am working on my own USB/serial connection.

Right now the LEDs are diffused by a piece of paper and are on one big circuit board; in the final version there will be 8 boards in an octagon inside a frosted glass cylinder.

I hope to be done by the end of the year.
447  Using Arduino / Microcontrollers / Re: Memory with Arduino Nano (w/ ATmega328) on: November 03, 2011, 11:05:50 am
50 x 50 = 2500, about 2.4K. Your Nano's CPU only has 2K of RAM. By default variables are kept in RAM because there's no way for the system to know you won't be changing those values.

If the lookup array will never change look up PROGMEM and it will show you how to keep that data in flash, instead of RAM.

Good luck!
448  Using Arduino / Project Guidance / Re: Two button counter on: October 30, 2011, 01:03:17 pm
You could start with one of the button libraries, that way you won't have to deal with debouncing etc. yourself. Here's one:

http://www.arduino.cc/playground/Code/Button

After that your code is going to be pretty simple...

Code:
if (button1.uniquePress()) {
    button1Counter++;
}
if (button2.uniquePress()) {
    button2Counter++;
}
ratio1 = 100 * button1 / button2;
ratio2 = 100 * button2 / button1;
lcd.clear();
lcd.print(ratio1);
lcd.print(ratio2)

Obviously this isn't real code...for example you'll need to deal with cases where the buttons have been pressed zero times, so you don't get divide by zero errors....

Good luck!
449  Using Arduino / Project Guidance / Re: Two button counter on: October 30, 2011, 12:20:25 pm
Start at the beginning. Like PaulS said there are plenty of examples here to help you out.

Get the basic 'blink' etc. programs working until you understand what they're doing. Then learn how to handle buttons, then learn the LCD library, etc. Basically keep breaking the project down into smaller pieces until you can handle them. Don't bite off more than you can chew -- for example until you've got your buttons working perfectly don't worry about the LCD, just use Serial.print()s and the IDE monitor.

Good luck!
450  Using Arduino / Project Guidance / Re: Arduino+iPhone on: October 29, 2011, 05:39:12 pm
There's lots of ways to do this...what you may want to do is get a WiFi shield for your Arduino, have it run a small web server, listen for web requests then do the hardware magic.

Alternatively, you can run the web server on a PC and have it communicate with the Arduino via the serial port. This would be cheaper than the WiFi shield, but obviously requires a PC that's close to the Arduino and turned on all the time.

As far as an app for the iPhone goes, you could either write one yourself or use something like Ciao (http://ciaoapp.com/) or just use Safari to talk to the web server on the Arduino.

What you want to do is totally possible, but will require some work. My advise is to get the project working in parts. First get the servers working with the Arduino directly, then add the WiFi, then the web server, etc.

Good luck!
Pages: 1 ... 28 29 [30] 31 32 ... 37