Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
UberVexer
Jan 5, 2006

I like trains

valve posted:

I'm not massively familiar with the capabilities of the Arduino, but i'm looking to use one (or a similar microcontroller) for a project I have in mind. I need to read values for up to 64 ADCs (well initially i'll be building with just 8, but the final project will have 64), and then store these values and send them back out to the same number of DACs.

My plan is to drive it all serially, and develop it to have 8 chip selects, with each ADC and DAC IC having 8 devices within (the 8 chip selects bringing to total to the 64).

Is this something that the Arduino is capable of (even for the 8 channels), or do I need something with a lot more power?

(note: it's not an audio interface, it's reading data from a fader, and writing to a VCA for level control-- there is no audio)

This couldn't be done with an Arduino by itself, you'd need to do some multiplexing to achieve this, or have several DACs connected to the I2C bus of the Arduino. Doing the latter of the two is easier and will probably yield better results for whatever you are doing.

Edit: This should go without saying, but make sure you get a DAC that is I2C compatible.

Adbot
ADBOT LOVES YOU

UberVexer
Jan 5, 2006

I like trains

Delta-Wye posted:

:raise:
I think you want

code:
if (thing == 1 || thing == 2) {
    //do something
}
if you have a series of these, they can be done with a case as well:
code:
switch (thing)
{
case 1:
case 2: 
    //do something if == 1 or 2
    break;
case 3: 
    //do something else if == 3
    break;
case 4:
case 5:
    //do this if == 4 or 5
    break;
default: 
    //or do something by default
    break;
}

Theoretically
"if(thing1== 1 || thing == 2)" is correct, assuming you have only one statement coming after it, that is
"if(thing1== 1 || thing == 2)
digitalWrite(13,1);"

It is just bad practice.


huhu posted:

Time to ask some dumb questions!

What exactly is a ground? I've taken elements of electrical engineering for my mechanical engineering major and we did some circuit stuff but I feel the explanation of what a ground is was completely off. I thought all circuits had to be in a loop but supposedly thee ground can sometimes serve as a completion of the loop?

I set up some code so that 11, 12, and 13, from the Arduino would power three separate LEDs. One of them was much brighter than the other two. I tried moving the LEDs to different spots on the breadboard, changed the LEDs, and changed the Arduino to 10, 11, and 12 and still got the same thing. Thoughts?

How do you go about picking a resistor? Like in the case of 330Ω vs 10kΩ? My kit came with those two values.

- Ground on AC or DC circuits have different meanings, so I will leave that alone as I don't want you to explode, I'm no expert on that.
- You probably have the Arduino powered by USB, which is relatively low power, try connecting to a 9-12VDC wall wart.
- Ohm's law. V=I*R where I = current, R = Resistance, and V is the voltage. So for the case of an LED you'd use
(Source Volts - LED Volts) / (Current / 1000) = Resistance

Building on that last point about resistors, you might find you get some weird values, if you feel lazy just pick the easiest one to purchase that is closest to your value, if you get 350 ohms, feel free to use a 330, because you can actually find them; or put them in series.

UberVexer fucked around with this message at 06:55 on Nov 24, 2012

UberVexer
Jan 5, 2006

I like trains
I have been thinking of some projects lately that need a ton of GPIO pins, so I spent some of the day today working on this board.



This will give me 128 digital pins to mess around with, while remaining Arduino IDE compatible, and not requiring me to use a shield or anything. The design will change before I have them made, because I made some stupid decisions in the middle of the game here. I'll chuck the board and schematic files up on github when I'm done.

UberVexer
Jan 5, 2006

I like trains

SoundMonkey posted:

I assume that's the MCU on the bottom with a bunch of multiplexers above? Is that a 32U4 or something else entirely?

328 at the bottom (uno) and some MCP23017 chips up top, they're i2c IO expanders.

UberVexer
Jan 5, 2006

I like trains

SoundMonkey posted:

Ah, I was just like "Oh I bet he's being fancy and using a 32U4" and the pin count looked about right :downs:

I think the footprint is the same for the SMT 328 and the 32U4, but the pinout is different.

USB isn't that important to me for this board, but maybe I'll do that and try to sell a couple of them in the mart or tindie or whatever.

UberVexer fucked around with this message at 01:26 on Jan 21, 2015

UberVexer
Jan 5, 2006

I like trains

SoundMonkey posted:

- there's almost no documentation

Sometime when I was first playing with wifi, I ended up with a "Wifly" module, the docs were terrible at the time, and it discouraged me from finishing that project.

If you end up with that chip, post your experience.

UberVexer
Jan 5, 2006

I like trains
https://www.tindie.com/products/AtomSoft/esp8266-buddy/?utm_source=twitter&utm_medium=twitter&utm_campaign=new_product_tweets

This just popped up on my Twitter feed. Maybe I'll pickup one of those cheap ones from eBay.

Edit: Some poking around on hackaday got me this. There's a whole bunch of documentation floating around for this thing I guess.

https://github.com/bafeigum/ESP8266-Library
http://hackaday.io/project/2879-esp8266-wifi-module-library

UberVexer fucked around with this message at 17:07 on Jan 21, 2015

UberVexer
Jan 5, 2006

I like trains

peepsalot posted:

eh, just grab some pliers and bend the pins 90 degrees

You should feel honored now.

Question about programming with an external programmer: I think I've accidentally set lock bits that lock me out of using an ISP, is there a way to fix that?

UberVexer
Jan 5, 2006

I like trains

nonentity posted:

[words and photo]

That project is really coming along nicely. Maybe I'll make one eventually.

UberVexer
Jan 5, 2006

I like trains

PRADA SLUT posted:

Where can you get one of those baseplates that hold an Arduino and a breadboard? Just the plastic piece alone (I guess it could include a breadboard if needed).

I got one from a sparkfun dumpster dive at one point or another.

They sell them without breadboards for pretty cheap, but I'd guess it'd be hard to justify shipping one. https://www.sparkfun.com/products/11235

UberVexer
Jan 5, 2006

I like trains
Has anyone had experience reading electric guitar output on an analog pin?
I figure I can boost it with an op amp, but is there a better way?

UberVexer
Jan 5, 2006

I like trains

huhu posted:

I just read an article about a guy that makes prototypes for people for a living. I'm curious, if anyone here has worked on a prototype for someone and if so, how did you meet them?

I've done some contract prototyping. I used have an interesting work situation, where my office was in an art gallery, and artists usually have the half-baked ideas that were mentioned before.
The problem with working on half-baked ideas is that without a clear goal, you're basically guessing at what they really want.

I had a pretty great professor during college also. I needed some cash to exist, and he hired me to do board design for him during breaks; he even got me an Altium seat when I was working for him.

UberVexer
Jan 5, 2006

I like trains

Rapulum_Dei posted:

im sure I saw a cheap service to get small amounts of pcb designs printed and delivered.

oshpark is the one that comes to mind immediately.


First Time Caller posted:

Question: What resources should I look at for figuring out how to design a PCB so I can fit this into a small box?

Go download Eagle and watch some tutorials. Eagle is free for hobbyists. Altium has a free hobbyist program out now also, but I haven't seen much about it.

https://www.youtube.com/watch?v=NJKZZArjdg8

https://www.youtube.com/watch?v=JANZsjRiM3w

This dude makes some pretty good videos about best practices.

UberVexer
Jan 5, 2006

I like trains

Sagebrush posted:

Should be able to fix it just fine with a regular ICSP programmer.

This is true for most Arduino problems.

If you're not messing around with Megas or anything you can grab one of the cheap programmers from Sparkfun or Adafruit, but it's totally worth getting one of the Atmel ICE programmers if you can.

UberVexer
Jan 5, 2006

I like trains

Sagebrush posted:

I don't think you can flash the UNO to work that way. It has an FTDI USB/serial chip that does the USB communication, and that chip's behavior can't be changed with the Arduino code (which only runs on the ATMega). Your computer is always going to see an FTDI USB/serial device, not a keyboard.

The UNO R3 ships with an AtMega16u2 as the communication chip. It can be reflashed to act as a HID, projects like UnoJoy take serious advantage of this.

It can be flashed to act as an HID that takes commands from the 328 on the board, but as mentioned above, you can't program the 328 while it's in that mode.

If you're going to bother doing it, you might as well get a Leonardo.

UberVexer fucked around with this message at 17:38 on Oct 23, 2016

UberVexer
Jan 5, 2006

I like trains

evil_bunnY posted:

I just got a bitching hall effect 3 axis gimbal to make a mouse emulator. At some point it might get changed to xbox360 (Xinput) spoofing since modern games tend to like that more. I have no idea what I'm doing.

https://github.com/AlanChatham/UnoJoy

I've mentioned this project earlier in the thread, but it lets you turn an Arduino UNO (they have it for leonardo also) into a Joystick device for computers or PS3.

I used it a bunch to make accessibility controllers in 2013 for one of my friends with CP.

It should give you some idea of what you're doing.

UberVexer
Jan 5, 2006

I like trains

coyo7e posted:

find someone who can create housings and stuff for you, etc.

Radio Shack still has enclosures in the US, if you care to pay for them.

You can find a ton of enclosures on AliExpress that you can drill out to fit whatever buttons you want. Often enough those sellers will also cut out what you want, if you're talking about putting a small LCD screen, or something in your project.

UberVexer
Jan 5, 2006

I like trains

bad posts ahead!!! posted:

I have, but it doesn't seem like I can learn to write from scratch from this

Find a canned project that you're interested in, and follow the code.

Stepping a motor is logically equivalent to blinking an LED fast, usually.

UberVexer
Jan 5, 2006

I like trains

rawrr posted:

What are some examples of arduino projects that have well structured, well written code, ideally making use of different libraries and interfacing with different hardware components (i.e. sensors, 7 segment displays, relays)?

I'm embarking on project and would like some good examples to emulate/reference. Articles/books on the best practices for this sort of thing would be appreciated, too.

Depending on how much code you want to go through, the Marlin firmware for the RepRap is a pretty good example of using sensors, moving motors, and printing stuff to LCD screens.

If that's not something you want to read, Adafruit has a ton of projects in their learn system that are structured well, commented well, and are useful examples of how libraries work.

UberVexer
Jan 5, 2006

I like trains

Sagebrush posted:

spaghetti logic wrapped up in a gigantic switch/case statement.

This is the best summary of that code I have ever seen.

Adbot
ADBOT LOVES YOU

UberVexer
Jan 5, 2006

I like trains

Sagebrush posted:

Chances are that it's the FTDI (or CH340 if it's a cheapy) USB-to-serial converter chip.

The Claptain posted:

Little touch with soldering iron, and it was working again.

Newer Arduino Uno/Mega boards are using an entire QFN-ATMega16u2 as the USB-to-serial converter, and trying to resolder those is a pain when anything is around them.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply