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
Globofglob
Jan 14, 2008

Aurium posted:

1.) It depends on why it's broken. Some motor shields can't be stacked at all, which wouldn't be the due's fault. Libraries for the stack able ones might use Port manipulation commands that would need to be changed for the due. If you're decent at programming, you could probably fix or write your own library. Link what you're thinking of using if you want further opinions.

2. If you plug high enough voltage into the barrel jack/Vin it will automatically block power from the usb port.

1. The sources I'm using to determine why shields in general can't be stacked on the Arduino DUE are
http://www.mathworks.com/help/supportpkg/arduinoio/ug/cannot-stack-motor-shields.html - which states that shields cannot be stacked on the arduino
https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/faq - As of Arduino 1.5.6-r2 BETA, there is a bug in the Due Wire library that prevents multiple Motor Shields from working properly!

I'm using a Polulu shield, the MC33926, but I'm still worried I'll find this bug. There seems to be no documentation of it anywhere but ont he Adafruit site.

2. What constitutes a high enough voltage?

Adbot
ADBOT LOVES YOU

Aurium
Oct 10, 2010

Globofglob posted:

1. The sources I'm using to determine why shields in general can't be stacked on the Arduino DUE are
http://www.mathworks.com/help/supportpkg/arduinoio/ug/cannot-stack-motor-shields.html - which states that shields cannot be stacked on the arduino
https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/faq - As of Arduino 1.5.6-r2 BETA, there is a bug in the Due Wire library that prevents multiple Motor Shields from working properly!

I'm using a Polulu shield, the MC33926, but I'm still worried I'll find this bug. There seems to be no documentation of it anywhere but ont he Adafruit site.

2. What constitutes a high enough voltage?

1. I'm going to assume that you mean This shield. What I have to tell you will vary quite a bit between different ones.

It will work with the Due, as this is not an addressed shield, it's basically a breakout board for a bare h-bridge.

The inputs to that shield are nothing more than Direction per motor, and PWM per motor, and has you connect those inputs to any pin that you desire. All you have to do is solder it appropriately. But it does require 2 pins per motor. Just pick different pins for every shield, and you'd be fine. See the instructions for Remapping the Arduino Connections.

As that shield would work with no problems (but some soldering), I am going to go into some more technical stuff.

The other style of shield would have data in and data out lines and would via programming / dedicated chips pay attention only to what is talking to it, and ignore all other commands. That means that if you had a motor shield like this, you would only need 2 pins total for an arbitrary number of motors.

The wire library (which is a library for the i2c protocol) is one of the ways that is used to talk to only what you want to talk to with only 2 wires. There's been a couple of releases since then and one says that it fixed some Due wire library issues. I couldn't tell you if it fixes these ones or not. The mathworks site has no information at all as to why, but I'm guessing they're referring to the same bug. Fixing this library would be a real pain, and is not something that I would recommend.

There are some other schemes to reduce the number of pins needed, such as shift registers. One of the adafruit motor shields uses them. If the driving library for that style was broken on the Due, that wouldn't be so hard to fix yourself. The adafruit shield that Hadlock linked though IS i2c (the wire library), and thus would be broken on the due if this bug hasn't been fixed yet.

2. Probably any voltage that it will power up with off the jack. I'm not exactly sure for the Due. For the Uno/Mega it's ~7 volts. If a chip on the the board detects that much voltage on the jack it automatically switches over. So basically any power supply that is capable of running the Arduino from the jack turns off usb power.

The reason why I'm not sure exactly for the Due is because 7 volts was chosen because the Uno/Mega run on 5 volts, and the regulator needs ~2v of overhead to work. As the Due runs on 3.3v internally, the jack could potentially detect as low as ~5.3v on it and shut down usb then, or they might have just left the original 7 volt detecting circuit alone.

That said, as their design goal would be to shut down USB power if it's plugged in externally, I suspect that any thing that can run the Arduino though the jack would shut down USB power properly.

TheLastManStanding
Jan 14, 2008
Mash Buttons!
This shield? As far as I can tell it's pwm controlled so it shouldn't be a problem (the Due library issue affects I2C devices), though you will probably have to poke around the library to reassign the pins or write your own code to run the motors as it isn't stackable straight out of the box.
e:fb

Globofglob
Jan 14, 2008

Aurium posted:

1. I'm going to assume that you mean This shield. What I have to tell you will vary quite a bit between different ones.

It will work with the Due, as this is not an addressed shield, it's basically a breakout board for a bare h-bridge.

The inputs to that shield are nothing more than Direction per motor, and PWM per motor, and has you connect those inputs to any pin that you desire. All you have to do is solder it appropriately. But it does require 2 pins per motor. Just pick different pins for every shield, and you'd be fine. See the instructions for Remapping the Arduino Connections.

As that shield would work with no problems (but some soldering), I am going to go into some more technical stuff.

The other style of shield would have data in and data out lines and would via programming / dedicated chips pay attention only to what is talking to it, and ignore all other commands. That means that if you had a motor shield like this, you would only need 2 pins total for an arbitrary number of motors.

The wire library (which is a library for the i2c protocol) is one of the ways that is used to talk to only what you want to talk to with only 2 wires. There's been a couple of releases since then and one says that it fixed some Due wire library issues. I couldn't tell you if it fixes these ones or not. The mathworks site has no information at all as to why, but I'm guessing they're referring to the same bug. Fixing this library would be a real pain, and is not something that I would recommend.

There are some other schemes to reduce the number of pins needed, such as shift registers. One of the adafruit motor shields uses them. If the driving library for that style was broken on the Due, that wouldn't be so hard to fix yourself. The adafruit shield that Hadlock linked though IS i2c (the wire library), and thus would be broken on the due if this bug hasn't been fixed yet.

2. Probably any voltage that it will power up with off the jack. I'm not exactly sure for the Due. For the Uno/Mega it's ~7 volts. If a chip on the the board detects that much voltage on the jack it automatically switches over. So basically any power supply that is capable of running the Arduino from the jack turns off usb power.

The reason why I'm not sure exactly for the Due is because 7 volts was chosen because the Uno/Mega run on 5 volts, and the regulator needs ~2v of overhead to work. As the Due runs on 3.3v internally, the jack could potentially detect as low as ~5.3v on it and shut down usb then, or they might have just left the original 7 volt detecting circuit alone.

That said, as their design goal would be to shut down USB power if it's plugged in externally, I suspect that any thing that can run the Arduino though the jack would shut down USB power properly.

TheLastManStanding posted:

This shield? As far as I can tell it's pwm controlled so it shouldn't be a problem (the Due library issue affects I2C devices), though you will probably have to poke around the library to reassign the pins or write your own code to run the motors as it isn't stackable straight out of the box.
e:fb

Thanks for the help guys; I'll go ahead with it then.

DaveSauce
Feb 15, 2004

Oh, how awkward.

Aurium posted:

It won't complain, but you might have to have some fun with type casting to get your desired behavior.

To me though, it seems less immediately obvious what would be going on while reading the code. So, excessively clever.

I'm not sure exactly how you're counting, but it sounds kind of like you're pulling the result off the internal microsecond counter. So another thing you might want to be concerned with is that on the 16mhz boards, micros() has a resolution of 4 uS. So the return will always be a multiple of 4.

I do like to be excessively clever. But code readability is always a concern of mine. I solved the problem by adding a task.enabled bool to the struct, now I'll just handle timer=0 as a run anyhow command...just in case I ever pull off a sub-us scan time, which I doubt will ever happen.

And it's good to know the clock resolution. Shouldn't affect what I'm doing at 4 us, but a good thing to know.

Super Waffle
Sep 25, 2007

I'm a hermaphrodite and my parents (40K nerds) named me Slaanesh, THANKS MOM
Hey guys, whats a good starter kit for Arduino? I've never done any coding or electronics work but I'm interested in starting out. I found this one but it seems to be discontinued in some stores but not in others. Is it a good kit?

http://store.arduino.cc/product/K000007

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

Super Waffle posted:

Hey guys, whats a good starter kit for Arduino? I've never done any coding or electronics work but I'm interested in starting out. I found this one but it seems to be discontinued in some stores but not in others. Is it a good kit?

http://store.arduino.cc/product/K000007


Buy a Nano + Solderless Breadboard from China Ebay for $5, then when you blow it up by accident you don't have to spend $20 replacing it :)

Serious post:

this looks neat:

http://www.ebay.co.uk/itm/UK-UNO-R3...=item3ce8ce0e13

Amberskin
Dec 22, 2013

We come in peace! Legit!

UberVexer posted:

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?

High voltage programmers. This one, for example

http://www.instructables.com/id/AVR-High-voltage-programming-Fuses-rescue/

Disclaimer: I have zero experience with that stuff. Concidentally, I'm planning to burnplay with some bare atmel micros and so I have been documenting myself about these things.

Hadlock
Nov 9, 2004


I wish I had bought one of those starting off.

And yeah, a Arduino Nano knockoff with the CF340 chip for ~$3.50 USD shipped from China is a smoking deal, even if you have to wait two weeks for it to arrive. I have one that's hooked up to a GPS chip and acts as a network time server for my home LAN.

Globofglob
Jan 14, 2008
Ok, so I've been making a circuit diagram of an Arduino DUE with two of these things as shields:
https://www.pololu.com/docs/0J55/3.c

I was wondering, since they're seem to use the same pins, would it be possible to drive 4 motors off of these, or would I have to reassign the pins of the second board, or use it as a motor driver rather than a shield?

2. Also, If they work as shields would they power each other, as they can power the arduino from the shield, or would I have to power both off of the same battery and get a Y-connector or something?

3. If I wanted to use voltage regulators, would I put them between the Battery and the shield, or the shield and the motor? I'm using a 7.4V battery and I plan to use step-up 12V Regulator to power a shield, which will power a motor and a 6V regulator, and the 6V reg goes to a micromotor.

Battery->12V reg->Arduino Shield->Motor
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\->6V regulator->Micromotor

Are there any major issues with this design?

Globofglob fucked around with this message at 02:11 on Feb 8, 2015

TheresaJayne
Jul 1, 2011
I tried a program over the weekend,

I have an arduino Uno,
Pin 9 - Servo connection (also connected to +5 and gnd on appropriate wires)
Pin 1 - connected to +5 via Switch (do i need a resistor on this)
Pin 2 - connected to +5 via switch (do i need a resistor on this)

The premise, on reset - servo goes to pos 0
press pin1 (and hold) servo goes to pos 180
now it just waits until pin2 goes high then back to pos 0

The final setup will be for a locking box, when the lid closes it triggers pin 1 locking the box until the reed switches hidden somewhere on the case connected in serial are all correct (ie NSNSSNSNSS code)
(pin2) to unlock the box so you can open it resetting the connection and the operation.

Unfortunately it wasn't working at all on the breadboard. The servo would go to the locked position and stay there,
Also even though i stop processing pin1 it will not process the pin2 until pin1 is low.

can anyone see any problems with my sketch?

code:
#include "Servo.h"

Servo servo;

boolean locker;
int servoPos;
int pinRead;
void setup()
{
  locker = false;
  pinMode(1,INPUT);
  pinMode(2,INPUT);
  servo.attach(9);
  servoPos = 0;
  servo.write(servoPos); //Set to unlock position
}

void loop()
{
  if(locker == false)
  {
    pinRead = digitalRead(1);
    if (pinRead == HIGH)
    {
      servoPos = 180;
      locker = true;
      servo.write(servoPos);                                    
    }
  }
  else
  {
    pinRead = digitalRead(2);
    if(pinRead == HIGH)
    {
      servoPos = 0;
        servo.write(servoPos);
      delay(20000);
    }
  }
}

Dynamite Dog
Dec 12, 2012

Where is locker set to false outside of the setup?

TheresaJayne
Jul 1, 2011

Dynamite Dog posted:

Where is locker set to false outside of the setup?

its not supposed to be, after a reset its set to open, and locker = false, so its monitoring pin1 waiting for the trigger,
Then when triggered it never goes back into the false state until a reset(ie press the reset button or repower)

Dynamite Dog
Dec 12, 2012

Well the code looks like it should work. If your servo works with a basic sweep program I'd look at the wiring for the switches, can you post a sketch or something?

TheresaJayne
Jul 1, 2011

Dynamite Dog posted:

Well the code looks like it should work. If your servo works with a basic sweep program I'd look at the wiring for the switches, can you post a sketch or something?

Not at the moment i am at work but it was using a breadboard. and i checked it was working with a meter.

TheLastManStanding
Jan 14, 2008
Mash Buttons!
Never use delay. It's a trap that always gets used wrong and either screws things up or slows things down. Use a timed loop.
code:
unsigned long timer;

void loop() {
  if (millis() - timer >= 50){
    timer = millis();

    // your code here

  }
}
It would also be beneficial to look into interrupts, which prevent you from missing button inputs (through in your situation a missed input wouldn't be a big deal). And yes, you should put resistors on those inputs (the arduino has it's own when used as inputs, which the pins are set to by default, but adding your own 320ish ohm resistor prevents you from frying the pins when you accidentally set them to outputs).

Hadlock
Nov 9, 2004

Can someone write me a very simple millis example or pseudo code of sweeping two servos at different rates?

TheLastManStanding
Jan 14, 2008
Mash Buttons!
There are libraries for this sort of thing which use timer interrupts, which would be preferable if you have a bunch of servos. If you want to code it out the following can be expanded to however many you need.

code:
unsigned long timer; // main loop timer
unsigned long s1Timer // keeps track of last servo update
unsigned long s1Rate = 1000; // movement rate in milliseconds per degree
int s1CPosition = 0; // current position
int s1DPosition = 0; // desired position

void loop() {
  if (millis() - timer >= 50) {
    timer = millis();
    // main code goes here, this is where you set the desired servo positions
    if(whatever) s1DPosition = 180;
  }

  if(millis() - s1Timer >= s1Rate && s1CPosition != s1DPosition) { // duplicate this whole 'if' for each servo
    s1Timer = millis();
    (s1DPosition > s1CPosition) ? s1CPosition++ : s1CPosition--;
    servo.write(s1CPosition);
  }
}
I left out the setup, but this should be enough to provide an example.

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
I'm currently struggling with trying to get a Wiznet 820io Ethernet module to work with an Arduino Micro. I'm using the ICSP header for my SPI connections.

Part of the job is that you have to alter the standard library to support the w5200 chip, according to these directions: https://github.com/Wiznet/W5200_Arduino_Ethernet_Lib

I've also tried this library, which appears to be fairly similar: http://www.seeedstudio.com/wiki/File:W5200_Ethernet_Shield_Library.zip

Anyways, I'm just trying to do the standard DHCP address print example. The problem is, I'm not getting ANY feedback from the arduino usually. But after futzing with the wires for awhile, I'll look up, and see the "no IP" message in the terminal. I've checked my wiring and rung it out a few times, but I still can't quite grasp what I'm doing wrong. Any suggestions for troubleshooting?

Edit: I've tried using my uno this morning and it works perfectly. Maybe something weird about the library's interaction with the micro?

Fanged Lawn Wormy fucked around with this message at 16:27 on Feb 11, 2015

Amberskin
Dec 22, 2013

We come in peace! Legit!

Fanged Lawn Wormy posted:

I'm currently struggling with trying to get a Wiznet 820io Ethernet module to work with an Arduino Micro. I'm using the ICSP header for my SPI connections.

Part of the job is that you have to alter the standard library to support the w5200 chip, according to these directions: https://github.com/Wiznet/W5200_Arduino_Ethernet_Lib

I've also tried this library, which appears to be fairly similar: http://www.seeedstudio.com/wiki/File:W5200_Ethernet_Shield_Library.zip

Anyways, I'm just trying to do the standard DHCP address print example. The problem is, I'm not getting ANY feedback from the arduino usually. But after futzing with the wires for awhile, I'll look up, and see the "no IP" message in the terminal. I've checked my wiring and rung it out a few times, but I still can't quite grasp what I'm doing wrong. Any suggestions for troubleshooting?

Edit: I've tried using my uno this morning and it works perfectly. Maybe something weird about the library's interaction with the micro?

The micro is like a Leonardo. There are some pin differences between the Leonardo and the UNO, specifically related to SPI. If that ethernet library uses SPI then you will probably have to use different pins.

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
I was aware of the pin issue - I've been using both the ICSP header and the specific SPI pins on the board itself.

I actually got some progress later today: the dhcp and static IP sketches I've been trying will give me IP addresses now. I even got the UDP test to work. However, there's a weird catch: I have to hold the reset button on the arduino for a bit, and then it will correctly find it's IP. If I simply plug in my USB cable, or do a quick 'tap' for resetting, I often get an IP of 0.0.0.0, even if I'm telling it how to define it's IP in a static way.

Sketch example:
code:
#include <SPI.h>
#include <Ethernet.h>

// network configuration. dns server, gateway and subnet are optional.

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  


// the dns server ip
IPAddress dnServer(192, 168, 1, 11);
// the router's gateway address:
IPAddress gateway(192, 168, 1, 36);
// the subnet:
IPAddress subnet(255, 255, 255, 0);

//the IP address is dependent on your network
IPAddress ip(192, 168, 1, 64);

void setup() {
  pinMode(10, OUTPUT);
  digitalWrite(10, LOW);
  
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(0);
  
  Serial.begin(9600);
  while(!Serial){
    ;
  }

  // initialize the ethernet device
  Ethernet.begin(mac, ip, dnServer, gateway, subnet);
  //print out the IP address
  Serial.print("My Static IP = ");
  Serial.println(Ethernet.localIP());
}

void loop() {
}
Note: when I started manually activating the SPI like in this sketch, it worked much more consistently.

SoundMonkey
Apr 22, 2006

I just push buttons.


Fanged Lawn Wormy posted:

I was aware of the pin issue - I've been using both the ICSP header and the specific SPI pins on the board itself.

I actually got some progress later today: the dhcp and static IP sketches I've been trying will give me IP addresses now. I even got the UDP test to work. However, there's a weird catch: I have to hold the reset button on the arduino for a bit, and then it will correctly find it's IP. If I simply plug in my USB cable, or do a quick 'tap' for resetting, I often get an IP of 0.0.0.0, even if I'm telling it how to define it's IP in a static way.

Sketch example:

Note: when I started manually activating the SPI like in this sketch, it worked much more consistently.

Have you tried throwing in a ~200ms delay after Ethernet.begin? I recall having similar problems once and the issue ended up being that the ethernet module hadn't gotten its poo poo together yet and I was already asking for its IP when it didn't have one yet.

Also I'm sure it's not an issue here but I generally change one digit of the MAC address when I use a library like this because you know EVERYONE is just gonna use the default as long as it works, perhaps even yourself, and one day you will end up on the same network as one of those devices.

wolrah
May 8, 2006
what?

SoundMonkey posted:

Also I'm sure it's not an issue here but I generally change one digit of the MAC address when I use a library like this because you know EVERYONE is just gonna use the default as long as it works, perhaps even yourself, and one day you will end up on the same network as one of those devices.

I like using IDs that no one is likely to commercially use in these cases. DE:AD:BE:EF:xx:xx, DE:FE:C8:xx:xx:xx, etc. Also a good way to handle USB device IDs, since USB SIG won't support an official range of IDs for tinkerers and such.

wolrah fucked around with this message at 21:41 on Feb 15, 2015

JawnV6
Jul 4, 2004

So hot ...
What about I2C addresses?

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!

SoundMonkey posted:

Have you tried throwing in a ~200ms delay after Ethernet.begin? I recall having similar problems once and the issue ended up being that the ethernet module hadn't gotten its poo poo together yet and I was already asking for its IP when it didn't have one yet.

Also I'm sure it's not an issue here but I generally change one digit of the MAC address when I use a library like this because you know EVERYONE is just gonna use the default as long as it works, perhaps even yourself, and one day you will end up on the same network as one of those devices.


Actually, I did try putting in a delay - even a few seconds - and it never seemed to make a difference. I eventually found posts like this: http://marco.guardigli.it/2010/11/arduino-wiznet-ethernet-shield-proper.html

Apparently some of the Arduino Ethernet shields had exactly the issue you talk about here: the AVR chip resets faster than the Wiznet chip, so you need a delay for them to catch up. I ended up finding I needed to reset the chip by tying the reset into another pin on the arduino, which I would then manually drive high-low-high to tell it to reset. This always works, but I hate that it ties up an extra pin. I may be able to get away with using the same SS pin, but I was actually trying to get away with not using an SS pin later (it will be the only SPI device) so I'm still not quite thrilled with the result.

Coldstone Cream-my-pants
Jun 21, 2007
Has anyone ever read a resistive touch panel with Arduino? They're surprisingly cheap so I think I'm going to pick one up to mess with. I'm just trying to decide if I need a driver. I'm not worried about saving on analog ports or anything.

Parts Kit
Jun 9, 2006

durr
i have a hole in my head
durr
If I want to multiplex an series of analog sensors, say a grid of photodiodes instead of a grid of LEDs, what IC chips should I be looking at for the job (and info on how to do it)?

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
Are you trying to read them all at once? How many are you using?

or maybe a better question: what is the application/purpose?

edit: I guess I'll at least try to be helpful.

A quick search showed me this: http://playground.arduino.cc/Learning/4051

I multiplexer chip would allow you to get analog readings from a bunch of different sources by using 3 digital pins to switch which source you're inputting into your single analog pin. It's supposed to be pretty fast, but I imagine it'd be pretty gross to have to try and read them all very fast.

something like this:
http://numato.com/digital-and-analog-io-expander-shield.html
would probably be faster

Fanged Lawn Wormy fucked around with this message at 06:13 on Mar 2, 2015

Acid Reflux
Oct 18, 2004

The Royal Scrub posted:

Has anyone ever read a resistive touch panel with Arduino? They're surprisingly cheap so I think I'm going to pick one up to mess with. I'm just trying to decide if I need a driver. I'm not worried about saving on analog ports or anything.

You won't need a driver, maybe just a couple of pull up resistors. It's quite literally as easy as connecting four wires and running the appropriate code. Do a Google search for "Arduino 4 wire touch screen", and you'll get more information than you'll even know what to do with. I haven't messed with one in a while, but even with my near-zero knowledge of the programming language, I was able to bluff my way through a few code samples and get several touch panels working with very little effort.

Coldstone Cream-my-pants
Jun 21, 2007

Acid Reflux posted:

You won't need a driver, maybe just a couple of pull up resistors. It's quite literally as easy as connecting four wires and running the appropriate code. Do a Google search for "Arduino 4 wire touch screen", and you'll get more information than you'll even know what to do with. I haven't messed with one in a while, but even with my near-zero knowledge of the programming language, I was able to bluff my way through a few code samples and get several touch panels working with very little effort.

Nice that's what I want to hear. Now I need to figure out something cool to do with it besides copy this:

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

Bondematt
Jan 26, 2007

Not too stupid

The Royal Scrub posted:

Nice that's what I want to hear. Now I need to figure out something cool to do with it besides copy this:

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

It sounds so angry when he moves it :3:

Captain Capacitor
Jan 21, 2008

The code you say?
Forgive the awful quality, but I made a thing.

https://www.youtube.com/watch?v=4j6CY-PdHpM

Arduino Yun + Space Engineers with a Web API that I modded into it.

Parts Kit
Jun 9, 2006

durr
i have a hole in my head
durr

Fanged Lawn Wormy posted:

Are you trying to read them all at once? How many are you using?

or maybe a better question: what is the application/purpose?

edit: I guess I'll at least try to be helpful.

A quick search showed me this: http://playground.arduino.cc/Learning/4051

I multiplexer chip would allow you to get analog readings from a bunch of different sources by using 3 digital pins to switch which source you're inputting into your single analog pin. It's supposed to be pretty fast, but I imagine it'd be pretty gross to have to try and read them all very fast.

something like this:
http://numato.com/digital-and-analog-io-expander-shield.html
would probably be faster
Well further research has shown that my idea would be horribly expensive to implement so it's scrapped. But just for the record the idea was to create a grid of photo-diodes, much like in how people create multiplexed LED grids. From there instead of blinking one line super fast as it scans it would be reading the voltages of one line and dumping that to a text file before moving onto the next one. So the final implementation would have this grid sensor behind a lens and then after a likely huge file was dumped to another program set up to assign grayscale values to the various voltage values the end result might maybe just be a very, very high speed scanned digital video.

Basically the project was to see if I could rig up a high speed, low res digital camcorder.

JawnV6
Jul 4, 2004

So hot ...

Parts Kit posted:

a very, very high speed scanned digital video.

I'm not sure if this killed it in addition to price, but I'm thinking any loop with 3 calls to digitalWrite for the select bits isn't going to be very high speed.

Captain Capacitor
Jan 21, 2008

The code you say?
Welp, I've managed to gently caress up my Yun somehow. Serial communication doesn't work with the 32u4 anymore and the device fails to enumerate via USB. I can still upload sketches via WiFi but it doesn't look like it's even communicating via the Bridge anymore. Balls.

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
Try posting in Arduino's forums, they have Yun subforum and are pretty helpful. I believe there's a sketch you can run on the 32u4 that will show you the serial port connected to the Linux side as it boots so you can see if something is causing it not to boot (although if you can upload sketches wirelessly the Linux side is probably fine since that's the part that handles wireless sketch uploads).

Captain Capacitor
Jan 21, 2008

The code you say?
Turns out they make power-only USB cables. And I somehow own two of them.

Bad Munki
Nov 4, 2008

We're all mad here.


Captain Capacitor posted:

Turns out they make power-only USB cables. And I somehow own two of them.

Haha, that's mean.

JawnV6
Jul 4, 2004

So hot ...

Captain Capacitor posted:

Turns out they make power-only USB cables. And I somehow own two of them.

What's the resistance between D+/D-?

Adbot
ADBOT LOVES YOU

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

Captain Capacitor posted:

Turns out they make power-only USB cables. And I somehow own two of them.

They're ever so slightly cheaper to manufacture, so they're more common than you might expect. They can be useful, though, if you want to let someone power/charge a device from a USB port on a computer but don't want their sketchy hardware connected (or if you don't want your hardware connected to a sketchy computer).

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