Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: 4x4x4 Cube? - Is it possible? on: August 01, 2008, 05:07:38 pm
A 4x4x4 cube has 64 LEDs; but I believe can be driven with 12 pins (4row  + 4column + 4layer) if you wire it properly; it's a lot easier to wire with 20 pins (4x4 matrix + 4layer); my 3x3x3 uses 12 pins (3x3matrix + 3layer) - a lot easier to wire and only "costs" 3 pins more.  Though, I'm trying to imagine the schematic and it's blowing my mind.  In theory, you could do a 5x cube with only 15 pins.

Different colors, of course, adds another dimension to the equation.
2  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 15, 2008, 09:47:35 am
Quote
Hehe, yeah most things I do with Arduino is pretty hacky. :-)

justfred replied to me separately that he figured out the problem by using "nunchuck_init_with_power()" instead of "nunchuck_init()".  The former is used when you have have the nunchuck plugged directly into the Arduino (pins 2&3 supply power) while the latter is used when you have the nunchuck plugged into breadboard and powered from a proper supply.  I really should've documented that better as it's confused a few people.

Thing is, with the blinkm in, it worked fine with just nunchuck_init() becase the blinkm was set to get power from those pins; but still caused some problem on the other side of the board.

Tonight I will have a nunchuck-driven piano!
3  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 14, 2008, 11:12:18 pm
Quote
Hi,  I'm the creator of the "wiichuck adapter" and the "nunchuck_funcs.h" library referenced by the OP.  Everything said above is correct as far as I know.  I've used a '595 with a Wii Nuchuck with no problems.  The "Wire" library and the underlying I2C stuff doesn't interfere with any digital or analog pins beyond analog pins 4 & 5.

justfred, the fact that the your '595 is "going crazy" makes me wonder if you've got some PWM going on.  Are you doing 'analogWrite() anywhere?  Alternatively, it could be that the pins going to the '595 aren't being configured as outputs.  Also what do you mean by "For this example, I'm not even connecting to the 595 pins from my program."  Do you mean you can't get data from the Nunchuck when it's the only thing connected to the Arduino?   Have you tried this?  Also, have you gotten the '595 to work with it being the only thing connected to the Arduino?
 
John_Ryan, I'm unclear what you mean by "The 'hack' seems to be on a continuous journey of corrections".  The only change made to the wiichuck adapter hardware & software in the two months since my blog post went online was the addition of the function "nuchuck_init_with_power()" to enable analog pins 2 & 3 to be used as power & ground so one doesn't need a breadboard and wiring to play with a Nunchuck with an Arduino.  This has been really popular with new Arduino users.


Thanks for getting back to me, todbot!  Didn't mean to imply that your stuff was a hack (except in the complimentary sense)!  Thought I'd read somewhere (Blinkm docs?) that using 2+3 was sub-optimal but easier.

I'm going to try to figure it out, but...
-Not using analogWrite anywhere.
-595 works great when I'm not loading nunchuck code.
-Only latchPin is configured as output to begin with; the others are set to output when data is sent out.  I'm using code almost directly from the ShiftOut page.
-Now I'm trying backtracking and adding the 595 code to the Blinkmchuck code.-Nunchuck works great when using only your code.  Except...interesting.  When I comment out the Blinkm code, the nunchuck code doesn't work!  This could very likely be the problem!

Code:
...
void setup()
{
...
    nunchuck_init(); // send the initilization handshake
    Serial.print("nunchuck ready\n");
...
}

Hmph.  This is with the Blinkm unplugged, and no 595 code or plugs.  I'll see what I can run down.

I've got the latest version of yr nunchuck_funcs code.

Well, heck, there it is.
nunchuck_init_with_power();
fixed it.  I had the new lib but the old code.
4  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 14, 2008, 11:56:21 am
Posted this question on the todbot page.

I'm suspecting power/ground/pullup issues on the i2c (using analog 2+3 for ground does seem odd/lazy, you're right), so that's the route I'll check next.  Actually I have a standard 2d accellerometer I'll probably use instead of the nunchuck for the project I'm working on a the moment, but I'd like to know if i2c and digital pins can play well with each other, for future projects.
5  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 14, 2008, 10:57:05 am
Quote
The hardware I2C on the ATMEGA168 uses the same pins as Analog 4 & 5.  So when I2C mode is enabled, these pins get converted to digital signals for the I2C connection and you can no longer use them for analog.  Since this is how the ATMEGA168 is built, you can't use other pins for hardware I2C.

There were some people working on a software I2C that could use different pins.  Search the forums for this.

Understood, but I don't think this is my problem; I'm using the standard i2c pins, analog 4 and 5; and somehow that's screwing up digital pins 8, 11, 12.  Does "i2c mode" disable/change other pins?
6  Forum 2005-2010 (read only) / Interfacing / i2c, wire.h and digital pin problems on: April 13, 2008, 09:42:26 pm
All,

I've got the Arduino working over i2c to the wii nunchuck and blinkm using wire.h as described by todbot.
http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
Analog pins 2,3,4,5

Separately, I have a 74HC595 working using the shiftout instructions.
http://www.arduino.cc/en/Tutorial/ShiftOut
5v, gnd, digital pins 8, 11, 12

I'd like to be able to send signals to the 595 based on values from the nunchuck.  Problem is, when I plug them both in together and run a program that includes the wire.h library, I get garbage out the pins for the 595, and I don't get readings from the nunchuck.  For this example, I'm not even connecting to the 595 pins from my program.

Any ideas why the wire.h or i2c code would be interfering with the analog pins?
7  Forum 2005-2010 (read only) / Troubleshooting / Re: I think I burned out my USB chip... on: April 18, 2008, 12:30:11 pm
Assuming it's only the USB chip, you could probably still program it with a FTDI cable.  $20 or so.

And/or mount the board in some permanent-ish non-usb project, buy another arduino, save the program to the new board, swap chips?
8  Forum 2005-2010 (read only) / Development / Re: A breadboardable Arduino clone with onboard US on: March 14, 2008, 07:25:23 pm
Looks nice.  But given the shape - I'm wondering why not swap the F USB for a M, give it a (removable) enclosure with holes/standard sockets in the side, and turn it into a key drive form factor?  Keyduino?
9  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: USB Suggestion on: April 01, 2008, 12:09:08 pm
Ditto me; I'd prefer mini-USB.  The current Arduino USB-B cable is what I think of as a "printer" connector.  My printer uses it, and that's it.

I've found mini-USB to be nicely standard.  Works for my camera (Nikon D70), several off-brand MP3 players, Symbol barcode scanner, Canon flat scanner, bluetooth headset (including power for charging), etc.  It's so standard that I have two cables hanging off my desk at all times waiting to be connected.  Also seems more "appropriate" for the Arduino somehow.

(Nikon used to use a similar but not the same cable that you had to buy for $30 from them.)

I also don't see the point in micro-usb.  mini-usb is plenty small enough.

Then again, I'm about to the point where I'm getting over needing the USB to be on-board, and am going to move to FTDI the next time I buy a board.  

BTW, Ipods use a custom connector (USB-A the other end).
http://www.sparkfun.com/commerce/product_info.php?products_id=704
My Palm Treo also uses a custom connector (USB-A at the other end).
10  Forum 2005-2010 (read only) / Interfacing / Re: ArDeci -> MAX7219 (x3) -> RGB 8x8 LED Matrix p on: March 31, 2008, 03:22:39 pm
(piggybacking onto this thread) I found an answer to this before, but now I can't relocate.

Where does one buy a MAX7219/MAX7221?  I guess I can get "samples" from
http://www.maxim-ic.com/
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1339/t/or
- or buy them for $14?  

Or Digikey, which I always find confusing because they have too many choices:
http://search.digikey.com/scripts/DkSearch/dksus.dll?lang=en&site=US&keywords=max7219&x=0&y=0
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=MAX7219ENG%2B-ND

Suggestions?
11  Forum 2005-2010 (read only) / Interfacing / Re: Multiple Nunchucks on I2C bus on: April 21, 2008, 03:19:57 pm
It's an interesting question - I could see applications for this - but in your case, why not use two arduinos?  It sounds like they will be controlling separate systems.
12  Forum 2005-2010 (read only) / Interfacing / Re: Array of optoisolators? on: April 07, 2008, 06:15:31 pm
(bump update)

Oops, I wasn't using resistors between the 595 and the 2501s.  I don't think I burned them up, but the tops of the chips seem to have some scarring!

I now have a module wired up as described, with LEDs on each channel, and I put the chips into sockets.

I have a bunch more chips and sockets on order from Mouser.

Am now researching PCB fabrication.  PBC123.com seems interesting; pretty steep prices for prototypes, but the prices drop when you order 10 or more.  It seems it'll also let me create a clean circuit diagram, which I'll try to accomplish and post tonight.

Anyone else interested in some of these boards if I get them working?  Should be useful for controlling external devices that have a lot of simple switches.


Version .02, original version, 2x595, ~4x2501 = 16 channels, with channel wires jumping over the 595s


Version .1 with resistors, LEDs, sockets and a bunch of scavenged optoisolators (wiring for the channels is underneath the board).  This has the input header, needs output header at the bottom so they can be chained.  Probably 2x the resistors I need, since they're the same value.


Version .1 wired to Arduino, with driven test board on top

13  Forum 2005-2010 (read only) / Interfacing / Re: Array of optoisolators? on: March 31, 2008, 11:37:45 am
(bump update)

I've managed to get this working, and it seems to be fairly useful, so I thought I'd share.

For each "module" I used a single 74HC595 and a pair of PS-2501-4; I can control 8 switches with 5 lines (ground, power, gate, latch, data) from the Arduino.  

I'm using code from http://www.arduino.cc/en/Tutorial/ShiftOut to drive the 74HC595.

The output pins drive the PS-2501-4 optoiosolators; common ground on the input side, 16 pins out to another card with device-specific wiring on the output side.  With the output side of that I should be able to drive an bunch of pretty much any sort of switch.  My test case is a musical keyboard with a matrix switch - 5x8.

If I then pass ground, power, gate, latch from the arduino and data out from the 74HC595 to another duplicate circuit, I can get 16 outputs from the same 5 inputs; I believe this can be extended with more "modules".

Right now this is soldered onto breadboards with lots of cross-wiring; eventually I'd like to learn how to etch circuit boards but I haven't gotten there yet (I still don't understand how to optimize the wiring to design a board with a minimum of cross-overs).  Actually if this worked and were correct I'd sort of like to have a bunch of them made up SMD in China or something.  I know it's something that's useful to me (I like to be able to pull the buttons/keyboards off devices and drive them from the Arduino without having to reverse engineer the entire device).

I'm not certain that I should be driving the 2501 directly from the 595 - I know there's an LED inside there, so it seems as if I should be resisting, but I'm not; maybe it's fine or maybe I'm burning the optos; I know I should be able to determine from the datasheet, but I'm not grokking it.

I'd also like to add indicator LEDs to each of the 595 output pins (with a switch that turns them on and off).  Should be easy enough if the 595 is providing enough volt/amp out.

If anyone has any suggestions I'd appreciate the feedback.  Wiring diagrams and pictures if I can remember to post them tonight.
14  Forum 2005-2010 (read only) / Interfacing / Array of optoisolators? on: February 27, 2008, 01:05:53 pm
Hello!  I'm new to the Arduino and to physical computing in general, though I'm pretty comfortable with soldering LEDs to sequencer chips; and I'm not that worried about the programming if I can get the hardware to work.  After following instructions for the LED cube, and getting most of the demos to work, I've played with the blinkm, an accelerometer, sonar sensor, 75HC595, etc.

I'd like to interface into a number of different "black box" devices that don't have standard interface ports; I'd just like to be able to bypass the buttons; for example I've got several toy musical keyboards, etc.  These don't have the same voltage as the Arduino (or each other), so I'd like to keep them physically separate but just be able to signal their buttons.  In the case of the keyboards, it's easier and more difficult because they're matrix switches - 5x8 so 13 switches can signal 40 different notes, but I have to activate two switches at a time.  I may also have this plugged into more than one "black-box" device at a time, say, multiple keyboards or keyboards plus children's toys plus smart greeting cards or whatever.

Looks like opto-isolators are the weapon of choice for this.  I've got a few 1-channels, and a few 4-channels, and I've gotten them to work blipping LEDs and triggering keys, but...

-(obligatory am-i-doing-this-all-wrong question) Is there some other sort of switch I should be using for this?  Relays and reed switches definitely seem like overkill; I was wondering if I could go in the other direction since the voltages are so low and use some simpler chip; I could probably even common-ground the devices if that would help.

-I've been running the input side directly from the arduino digital ports.  Should I be using a resistor?  I know I need a resistor with an LED, and the oi is just an led on a chip...  I may also be putting an led (or a matrix of them!) in-line just for fun to blink when the switch gets hit.

-Is there such a thing as a 16-channel (or more) opto-isolator?  Seems like 4 is the highest they go.  The cost isn't too bad at $1.50-$2.00 apiece but they take up a lot of board space.

-Really what I'd like is a driver (like a MAX7219 if I could find one; I'm using 74HC595 at the moment) combined with an array of external switches, such that I could drive any combination of switches; 32 or 64 switches would be optimal.  Otherwise I'll be building one of these that I can swap from device to device as I experiment.

-(finally) I'm still looking for clever ways to trigger the "frankenkeyboard" - array switches or sensors.  I'm considering things like hammer-activated metal plate swiches, Theremin-style sensors, motion/range sensors, etc.  So if you've read this far and can think of any "you've got to try this" switches or sensors, I'd love to hear suggestions!

Thanks in advance!
15  Forum 2005-2010 (read only) / Interfacing / Re: Writing data to Usb Memory Stick on: March 04, 2008, 12:42:25 pm
If it's outdoors, you could also use a GPS.  A bit of overkill, but might be useful anyway.
Pages: [1] 2