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
peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

SkunkDuster posted:

I don't have a specific question at the moment, but is this the right place to ask basic questions about the TI MSP-430 Launchpad?
This one is probably more appropriate: http://forums.somethingawful.com/showthread.php?threadid=3500975

Adbot
ADBOT LOVES YOU

Aurium
Oct 10, 2010

SkunkDuster posted:

I don't have a specific question at the moment, but is this the right place to ask basic questions about the TI MSP-430 Launchpad?


If you're running the energia environment (arduino port) I'd say yes, because you'd get more people familiar with the arduino functions here.

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

Behold babby's first ugly prototype battery discharger:





Veeb0rg
Jul 24, 2001

THIS CONVERSATION IS NONPRODUCTIVE!
Hey guys, been kicking an idea around and wanted to get some feedback. Basically I want to use an arduino to monitor the temperature of coolant and activate fans/relays at certain temperatures.

I would like to use it to convert my jeep from a mechanical/electric fan setup to a fully electric setup. The stock electric fan will stay but the mechanical fan is being replaced with a 2 speed electrical fan. I'd like to activate the fans in sequence as the coolant temp climbs. Low speed at 195°, High speed at 215° and the stock electric fan at 225°+. These are just rough numbers.

All the fans will be triggered by relays, no need for anything fancy like pwm.

How difficult would this be to accomplish? Should I hard wire the arduino to always be on or should I wire it to only turn on with the vehicles ignition?

Hadlock
Nov 9, 2004

That's basically the equivalent of telling the Arduino to turn on an LED when you push down a momentary button/switch. Slightly more complex, an extra two nested if loops.

I would rig up some sort of obnoxious piezo speaker rigged to a "dead man's switch" so that if your Arduino isn't performing as expected/dies you know immediately. Automotive grade electronics cost more because they're designed to survive the kinds of abuse Jeep owners throw at them. If your arduino dies and you don't find out about it until it's too late that could be very expensive.

That said, I would totally do that, let me know if you need any help, and post pictures! :dance:

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass

Veeb0rg posted:

Hey guys, been kicking an idea around and wanted to get some feedback. Basically I want to use an arduino to monitor the temperature of coolant and activate fans/relays at certain temperatures.

I would like to use it to convert my jeep from a mechanical/electric fan setup to a fully electric setup. The stock electric fan will stay but the mechanical fan is being replaced with a 2 speed electrical fan. I'd like to activate the fans in sequence as the coolant temp climbs. Low speed at 195°, High speed at 215° and the stock electric fan at 225°+. These are just rough numbers.

All the fans will be triggered by relays, no need for anything fancy like pwm.

How difficult would this be to accomplish? Should I hard wire the arduino to always be on or should I wire it to only turn on with the vehicles ignition?

Honestly I'm not sure I'd look at an Arduino for something like this where it's a critical system to the functioning of your car. I'd look at an electric fan controller for cars (like this: http://www.jegs.com/i/Proform/778/6...CFchffgodsHkOVw) as it's built to survive inside a very hot, potentially wet, etc. car engine bay. The price is probably cheaper than buying an Arduino plus relays, temp sensors, weatherproofing the case, etc. too. The last thing you want is to be stuck on the side of the road because a wire popped out of a header, a solder joint cracked, your code overflowed a variable unexpectedly, etc.

Where an Arduino would be neat is if you want to interface with your car's OBD-II or CAN bus, read sensor data, and then display it on a little OLED screen on your dash.

Veeb0rg
Jul 24, 2001

THIS CONVERSATION IS NONPRODUCTIVE!
It would be interesting but my jeep is old and dumb so no odb2.

The jeep has a temp gauge so I can monitor temps and the stock electric fan will still be controlled by the factory ecu we will just be adding another controller to the stock relay. I plan on hard wiring a switch that would allow me to manually turn the fan on high speed if the need should ever arise I just liked the idea of being able to fine tune the fan controller. Those generic/cheap fan controllers die quickly and usually don't work well.

I do appreciate the advice though. If you have an idea on what parts I would need maybe I can shop around and see about prices..

Hadlock
Nov 9, 2004

You should be able to drill a hole in your new radiator cap (keep the old one as a spare), JB Weld and similar epoxies are rated for at least 500 psi and way over 300F so it should have no trouble plugging a tiny hole for the wire. I wouldn't gently caress with your existing sensor as you don't want to deal with the voltage switch. Make sure you use Marine Grade copper wire for the wet side of your sensor setup. It's only a couple bucks extra but won't ever corrode in your lifetime.

If you set up an automotive grade 30 amp DPDT or TPDT toggle switch in the cabin you should be able to setup a manual override on the fan.

I would call up Mouser and tell them you need a 12v temp sensor with 3-5v output designed to be immersed in water continuously and rated to at least 250F and see what they say.

Once you finalize the whole thing, paint it all in epoxy to (Attempt to) prevent the things mod sassinator suggested. I still doubt it will last more than 2-3 years, but hey, you never know! That's what the manual backup is for.

Veeb0rg
Jul 24, 2001

THIS CONVERSATION IS NONPRODUCTIVE!
I'll be ordering an adapter that allows you to put a sensor inline with the radiator hose so no need to drill holes in the rad cap. Like this: https://01f6bbb.netsolstores.com/images/products/detail/insetadaptor.jpg

I was thinking of sinking at least some of the arduino into an expoy resin to help deal with water proofing plus putting it into a watertight box under the hood.

I wont be messing with any of the factory sensors or wiring beyond tapping into the factory relay for the factory fan as its used by the ecu when the a/c is on or when coolant temps get above something like 240°.

The manual override will just trigger the relay manually so no real need for a heavy duty switch like that. I always have spare relays in the jeep just in case.

This is as much of a learning experience for me as well as a practical thing for my jeep.

Veeb0rg fucked around with this message at 04:44 on Jul 21, 2015

Aurium
Oct 10, 2010
Sounds like grand fun!

One thing that you should consider is either powering your arduino off a separate battery (inconvenient to say the least), or get a proper automotive regulator to power it off. Terrible things happen to the electrical rails on a car. Huge positive and negative spikes (up to 60v according to some datasheets) happen with frightening frequency.

I've seen the LM2937 and LM2940 regulators recommended in the electronics thread before, but there are plenty of choices out there. Make sure to find the 5v variant. Take it's output and stick it onto the 5v rail.

Alternatively get a higher voltage one (>7v) and feed it into the barrel jack as normal. These are both low drop out regulators, so even a 12v one would work fine on the 13-14 volt of the battery. If you want to power any actual 12v stuff though, your choice is pretty clear.

There are also some automotive grade switching modules out there, but I don't have any recommendations there.

Amberskin
Dec 22, 2013

We come in peace! Legit!
Hi tinkergoons,

I am very bad at gardening (well, not really gardening, since I have just some plants in flowerpots) and I always forget to water my plants. I'm thinking about automating the whole thing, so I guess I'd need:

- Some kind of sensor to know if the soil is dry and watering is needed.
- Some kind of pump to suck water from a jar or whatever and, well, doing the watering.
- Some kind of relay or optocoupler to activate the pumps.

I have zero knowledge about this stuff. Has anyone built a similar setup (I know there are kits already built to do this, but that spoils all the fun...).

Collateral Damage
Jun 13, 2009

Not the answer you're looking for, but a low tech solution is to just get a water wick. It's basically just a cotton rope in a plastic sheath. Stick one end into the soil and the other in a container of water and the soil will automatically suck up water through the wick to stay moist.

It's saved several of my plants from my own neglect. :)

SomethingLiz
Jan 23, 2009
If you search for "Garduino" you'll find a bunch of gardening related projects and tutorials.

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

Amberskin posted:

Hi tinkergoons,

I am very bad at gardening (well, not really gardening, since I have just some plants in flowerpots) and I always forget to water my plants. I'm thinking about automating the whole thing, so I guess I'd need:

- Some kind of sensor to know if the soil is dry and watering is needed.
- Some kind of pump to suck water from a jar or whatever and, well, doing the watering.
- Some kind of relay or optocoupler to activate the pumps.

I have zero knowledge about this stuff. Has anyone built a similar setup (I know there are kits already built to do this, but that spoils all the fun...).

Not to discourage you from tinkering, but I'd recommend checking out the "global bucket" method for making a self-watering planter. The two I've built need less than bi-weekly watering even in the Georgia summer.

Hadlock
Nov 9, 2004

poeticoddity posted:

I'd recommend checking out the "global bucket" method for making a self-watering planter.

This is pretty cool, thanks!

Amberskin
Dec 22, 2013

We come in peace! Legit!
Thanks! I think I'll try first the low-tech solution.

VelociBacon
Dec 8, 2009

Just picked up an arduino starter kit - to play with obviously but also for a couple art projects I've had in mind. Do you guys in this thread have an IRC channel?

ImplicitAssembler
Jan 24, 2013

Amberskin posted:

Hi tinkergoons,

I am very bad at gardening (well, not really gardening, since I have just some plants in flowerpots) and I always forget to water my plants. I'm thinking about automating the whole thing, so I guess I'd need:

- Some kind of sensor to know if the soil is dry and watering is needed.
- Some kind of pump to suck water from a jar or whatever and, well, doing the watering.
- Some kind of relay or optocoupler to activate the pumps.

I have zero knowledge about this stuff. Has anyone built a similar setup (I know there are kits already built to do this, but that spoils all the fun...).

This should do it:

https://www.youtube.com/watch?v=1h6D_pkeoks

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

I'm having problems reading L-ion battery voltage when under load, from the analog pins on the arduino.

As soon as the load is connected (a power resistor with inline MOSFET to switch it) the voltage drops by a volt.

My multimeter connected in parallel reads the correct voltage.

The battery neg is commoned to the arduino gnd, and there is a 10k pull down resistor.

Am I doing something noobish?

CarForumPoster
Jun 26, 2013

⚡POWER⚡

This is basically porn for engineers.

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you

Jamsta posted:

My multimeter connected in parallel reads the correct voltage.
What's different between the multimeter connection points and arduino connection points? What analog reference voltage are you using?

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

Captain Cool posted:

What's different between the multimeter connection points and arduino connection points?

Bingo! I'm now connected directly from A3 to battery pos, and GND to battery neg. It was connected further upstream where the battery meets the power resistor/mosfet, I guess I was sampling a different part of the circuit and not the battery?

Interestingly if I disconnect VIN to the Arduino, it keeps the Arduino powered on via A3 from the battery.

What's the minimum I should do to isolate the battery?

Thanks

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you

Jamsta posted:

Interestingly if I disconnect VIN to the Arduino, it keeps the Arduino powered on via A3 from the battery.

What's the minimum I should do to isolate the battery?
You could try putting a resistor in line, 1k or more. That would drop the voltage severely if the arduino attempts to draw any significant power from that line. Hopefully that doesn't affect the voltage you read.

Or you could set up a voltage divider to drop the input voltage below the arduino's minimum supply voltage. If you change your ADC reference voltage to match, you wouldn't lose any resolution.

politicorific
Sep 15, 2007
edit - crap, this belongs in the electronics megathread, not here.

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

Captain Cool posted:

You could try putting a resistor in line, 1k or more. That would drop the voltage severely if the arduino attempts to draw any significant power from that line. Hopefully that doesn't affect the voltage you read.

Or you could set up a voltage divider to drop the input voltage below the arduino's minimum supply voltage. If you change your ADC reference voltage to match, you wouldn't lose any resolution.

Thanks, I'll give both a go.

VelociBacon
Dec 8, 2009

If I'm doing a project where I will have 15-20 LED's operating at the same voltage, is it easiest to control them in an array with the arduino with individual assignments or can I put them in series somehow?

E: for example is it possible for just the LED portion of the code to have something like:

code:

Int myLeds = 9;

Void Setup() {
pinMode (myLeds, OUTPUT);
}

Void Loop () {
DigitalWrite(myLeds, HIGH);
}

And have them all via pinout 9 and an appropriate resistor and the LEDs wired in a chain connected ground to +ive? Would I be able to power 15-20 LED's from the arduino's 5v (I'm guessing yes)?

Any input appreciated.

VelociBacon fucked around with this message at 10:48 on Jul 31, 2015

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

VelociBacon posted:

If I'm doing a project where I will have 15-20 LED's operating at the same voltage, is it easiest to control them in an array with the arduino with individual assignments or can I put them in series somehow?

If those are standard LEDs that draw 20ma each - that's the recommended max current PER PIN. You can get away with 2 per pin but its not recommended.

You'd be better off driving them from a switching transistor which can handle the greater loads from strings of LEDs.

Check out this stack exchange article for details:

http://electronics.stackexchange.com/questions/6093/how-to-pick-a-switching-transistor-to-drive-leds-or-how-to-read-a-transistor-d

In terms of code, once you've put the transistor and resistor on pin 9 - your code supplied will work.

VelociBacon
Dec 8, 2009

Jamsta posted:

If those are standard LEDs that draw 20ma each - that's the recommended max current PER PIN. You can get away with 2 per pin but its not recommended.

You'd be better off driving them from a switching transistor which can handle the greater loads from strings of LEDs.

Check out this stack exchange article for details:

http://electronics.stackexchange.com/questions/6093/how-to-pick-a-switching-transistor-to-drive-leds-or-how-to-read-a-transistor-d

In terms of code, once you've put the transistor and resistor on pin 9 - your code supplied will work.

Thanks, I'll take a look at this.

Aurium
Oct 10, 2010

Jamsta posted:

If those are standard LEDs that draw 20ma each - that's the recommended max current PER PIN. You can get away with 2 per pin but its not recommended.

You'd be better off driving them from a switching transistor which can handle the greater loads from strings of LEDs.

As long as your foward voltage is less than 2.5V, you could series 2 of them and be fine. You'd have a smaller resistor than you would otherwise, but overall current would still the same 20ma. If you paralleled individual led/resistor pairs you'd have the 40ma you're thinking of.

You could potentially even run 3 IR leds in series where a voltage drop of 1.2 is pretty typical. (5/3 = 1.6v > 1.2V).


VelociBacon posted:


And have them all via pinout 9 and an appropriate resistor and the LEDs wired in a chain connected ground to +ive? Would I be able to power 15-20 LED's from the arduino's 5v (I'm guessing yes)?

First, a summery, parallel sets of series led resistor pairs, and if you want to mess around more with values This is an incredibly good led calculator. The rest of this is the why, I tried to make it easy to follow with examples, so it ended up being long.

As described, it would never actually work. The arduino would be in no danger, but the leds would never actually turn on. LEDs have a voltage drop over them. A typical Red led is ~1.8 v, and it goes up from there, green is about 2, blue and white are around 3.6. That means that for a red led to turn on it needs to see at least 1.8 v across it.

If you put leds in series you add the voltage drop, so you'd need to put at least 18v across a chain of 10 red leds. But they would all see the same current. So the total consumption would be 20ma.

To power them all with less than 18v you'd have to put them in some kind of parallel configuration. The trivial example would be all of them parallel on a 1.8v source. As each of them would see the same 1.8v, they'd all light up, taking 20ma each. For a total current out of your power source of 200ma.

Note that the power is the same here. 18 * 20 = 1.8*200.*

A voltage source that is fixed at 5v (such as an arduino) means that it can only support 2 red leds in series. 2*1.8 is 3.6v. 3*1.8 is 5.4v.


*Unfortunately this only works with ideal diodes, and perfectly controlled voltage sources. In the real world, we don't have either. You either need a resistor (even do something like use an regulator to get 3.6v for your 3.6v led, it'll develop problems) or a current source. Note also that when you use a resistor it uses power too, because of that your power of doing it different ways is no longer equal.

For 2 diodes, with a 5v source, 1.8v drop, and 20ma. I can either parallel 2 180ohm resistor led sets**, for a total power of 216mW.
I could also series 2 leds, and a 82ohm resistor for a total power of 104.8 mW. That's less than half the used power, for the exact same amount of light.

You might think that this means series leds are the clear winner. What it actually comes down to is your power budget(can you support the additional 100mw?) your heat budget (100mw of heat isn't usually a problem) your price budget( a few more resistors are incredibly cheap) and your effort budget (you solder alot less with series, but you also have to do the calculations every time, and find the exact right resistor for every string). Lastly for longer strings you need to make sure you have a high enough voltage to run it. I typically find it easier to just have a resistor and a led value that I know works.

This is still an incredibly good led calculator.

**don't get clever and try to share 1 resistor with 2 parallel leds. It would work with ideal diodes. Ideal diodes don't exist, and the ones we have don't share current evenly, which means that you're setting yourself up for potential failure.

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
If you're driving a lot of LEDs you might look at using a constant current LED driver like this chip from TI: http://www.ti.com/product/tlc5952 It looks like a shift register so you just clock in bits to turn on and off LEDs (frees up a lot of GPIO on your Arduino too). You don't need any resistors, etc. and just hook it up with power to the LED and its ground into the inputs of the driver. You can dim them too. I don't think that chip comes in a DIP package but I've seen similar ones in DIP that are easily breadboarded. Or you can get something on a breakout like: https://www.adafruit.com/products/1429

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Aurium posted:

...
even do[ing] something like us[ing] an regulator to get 3.6v for your 3.6v led, it'll develop problems)
...

I'd never really thought of this before. Why can't you use a regulator set for the correct voltage to directly drive an LED?

edit: Duh. Linear regulators are constant voltage; LEDs require constant current. Teach me to post without thinking about something.

babyeatingpsychopath fucked around with this message at 21:21 on Jul 31, 2015

Aurium
Oct 10, 2010

babyeatingpsychopath posted:

I'd never really thought of this before. Why can't you use a regulator set for the correct voltage to directly drive an LED?

edit: Duh. Linear regulators are constant voltage; LEDs require constant current. Teach me to post without thinking about something.

That's a good way of thinking of it. If we look a bit more at it, we'll also see that a voltage source + a resistor make a sort of current source, because above the forward voltage (which is modeled as a fixed voltage drop), the LED can be modeled as a short circuit.

The why is kind of interesting too.

It's a few things. The first is that forward voltage doesn't really exist. It's actually an exponential curve. On a resistor it's a flat line, and ohms is a slope. With a 1ohm "slope", 1 v changes by 1 amp. For a led, a 1v change can change current by .1amp, or 1 amp, or 10amps, depending on where you are on the curve. Basically, the resistance changes depending on voltage. It's a sharp enough function that there's a point we call a forward voltage. The resistor works by putting enough voltage across the led that it's effective resistance is .1ohm(completely made up number), with barely affects the circuit when we have 200ohms in series with it.

If you had a specific voltage to put you exactly on the VI curve it would work. That said, the led's forward voltage has a tolerance. Which actually means that the VI curve can be shifted all over the place. Let's use the same Vf that we're used to though, it works pretty well as an approximation.

If we take the first white led datasheet I find, we see that the forward voltage is 3.0V (typical) 3.4V (max). Lets say we design our circuit for the 3.4v case. We want all leds to turn on. Lets also say we use a 3.4v supply, and we get 20ma on that VI curve, and a 1 ohm resistor to make the following math easy (pretend it's the inherent resistance of the wire i guess, or even the slope of the VI curve there). After that, we assemble a bunch, and put a 3.0v led in it (the forward voltage does vary after all) With a 3.0v led, that resistor now drops .4v, at 1 ohm, that means it's doing 400ma. 400 ma, on a led that is designed for 20ma will kill it. .4 v isn't a large shift though. Even a .1v shift would change your current by 100ma.

But, lets say you have a very precise regulator, and you've speced it to the exact individual led you have. You still have a problem. The VI curve is heat dependent. When the led gets hotter, the curve gets steeper, and you get more current at the same voltage. So you turn on the led at the precise voltage you need for your individual that you measure. It warms up a little, which means more current flows. Which means that it gets hotter. Which means more current flows. And you have the potential for thermal runaway.

So how does a constant current supply handle all of this, particularly on a voltage driven device? Well, as the current goes up, it sees that the current is too high, so it dials back the voltage.

goodness
Jan 3, 2012

When the light turns green, you go. When the light turns red, you stop. But what do you do when the light turns blue with orange and lavender spots?
For someone that knows nothing about code or electronics, what would be a good kit to start with? I am also planning to learn Python if that matters.

My goals for it are to help program automated garden/aquarium systems, maybe a little robotics, pair with electrical work to run a self-sufficient power grid, etc

goodness fucked around with this message at 06:06 on Aug 3, 2015

VelociBacon
Dec 8, 2009

goodness posted:

For someone that knows nothing about code or electronics, what would be a good kit to start with? I am also planning to learn Python if that matters.

My goals for it are to help program automated garden/aquarium systems, maybe a little robotics, pair with electrical work to run a self-sufficient power grid, etc

I grabbed this one and I'm very happy with it.

e: I got it off the shelf at a local shop and it was around $100 CAD.

Hadlock
Nov 9, 2004

I would just buy an arduino, those things are pretty bomb-proof for the novice. I'm specifically thinking about over/undervolting the arduino and whatnot. The IDE is pretty bare bones and extremely straight forward, and what you learn there you can take with you to a python environment. It doesn't do ten million things but it's pretty hard to catastrophically damage an arduino. At least, I haven't managed to fry any of mine yet.

The BeagleBone Black system is finally mature (they default to Debian linux now instead of garbage Angstrom linux)and uses Cloud9 as a web based python dev environment and is a lot more powerful.

There's a lot of python dev tools for the Raspberry pi as well not to mention a bajillion prebuilt distro images to choose from.

But I would cut your teeth on Arduino, and when you outgrow that, buy something more complicated. The beauty of Arduino is that there is no OS, no SSH networking, no updates, passwords etc etc added complexity; it's just you, software and hardware doing cool stuff like making lights blink.

Collateral Damage
Jun 13, 2009

Hadlock posted:

it's pretty hard to catastrophically damage an arduino. At least, I haven't managed to fry any of mine yet.
I think I managed to brick a friend's Nano. We hooked it up to a long Neopixels string and didn't tie the grounds together or put a resistor on the data pin. It seems to boot up (LEDs are flashing when it powers on) but the programmer doesn't work, avrdude just times out. :saddowns:

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

Collateral Damage posted:

I think I managed to brick a friend's Nano. We hooked it up to a long Neopixels string and didn't tie the grounds together or put a resistor on the data pin. It seems to boot up (LEDs are flashing when it powers on) but the programmer doesn't work, avrdude just times out. :saddowns:

When you plug it in, does anything get hot? The one time I properly wrecked an Uno, something (I want to say the voltage regulator, but it's been years) would get hot enough to burn skin in about 15 seconds.

Collateral Damage
Jun 13, 2009

I don't think so, but I don't have it here to check. It still works per se, the program we had loaded runs when it's powered on, we just can't reprogram it.

Another guess is that we toasted the UART, but it seems unlikely.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
I'm a web developer by trade, so everything I do I try to make super portable, easy to setup, maintain, and as "push button to go" as possible. I was hoping to have this kind of thinking doing Arduino dev, but I couldn't actually find anything that would accomplish a few simple tasks.

Cross platform compilation
On the assumption I might put my code on GitHub for others to contribute to, I wanted a standard way for people to compile my code with the least amount of pain.
PlatformIO is the best I've found so far, letting you use whatever IDE but compile via Python CLI to a range of devices on a number of platforms. Everything else I've seen has been total pig of custom setups and different ways to manage libraries. Speaking of which..

Dependency management
My code relies on a specific JSON library, so when people download my code they also need this library. How do I manage dependencies?

Traditionally, at least for the Arduino IDE you'd say "This thing requires X!" and someone would manually download it and stuff it into their ~/arduino/libs/hate/my/life/
I started out replacing that with GIT submodules, but then a lot of embedded code libraries aren't actually on GIT repos because they're old as hell.

I come from a PHP background, so I plugged in Composer to do the dependency management (one JSON file) and shazam, problem solved. I can grab code from GIT, ZIP, SVN, whatever.
PlatformIO is supposed to have some kind of dependency management included, but I couldn't get it to do what I wanted, much less download anything that wasn't on their package management system.

With this setup, it means the process for someone to grab and put my code onto their Arduino looks like:
code:
git clone my-simple-stuff
composer install
platformio run
Granted, this means my "simple" Arduino code now needs you to install two tools, which rely on Python and PHP, which isn't a small ask.
I'm hoping I can persuade the guys at PlatformIO to adopt something composer-like for dep management per-project, but until then I feel pretty stuck.

Am I doing this right? Is there a better way? It's all clunky as gently caress and no amount of googling has helped me so far. I find it impossible to believe I'm the only one who has considered this?

Adbot
ADBOT LOVES YOU

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you

v1nce posted:

I find it impossible to believe I'm the only one who has considered this?
While my experience is limited, you're trying to do a lot more than the actual embedded software teams I've worked on.

Embedded programming quickly gets very platform-specific. Each microprocessor has different peripherals with different configuration registers and features. Each board has different GPIO connections. High performance functions might be written in assembly. Abstractions make your code larger and slower, and code size is limited.

What kind of project are you thinking about where other people might want to run the same code on different architectures and different hardware configurations?

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