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
babyeatingpsychopath
Oct 28, 2000
Forum Veteran


FetusPorn posted:

Yeah, I know all the dirty business is hidden in the #include, but I'm gonna have to dig into that to see how they got it to be so optimized.

I gotta ask two things: How is count ever going to be <0 with count defined as an unsigned int?
Why not just use a byte for count and let the fact that it's only 8 bits wide clip your input?

Regardless, PORTA is a byte, so always clamp byte values.
code:
PORTA=(byte)(count&0xff);
I really like this debounce algorithm for debouncing rotary encoders.

Adbot
ADBOT LOVES YOU

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
Yeah try it with floats, I have a feeling you'll find it's good enough. And if not, there are other tricks you could do like at boot build up a table of ~100 or so entries with precomputed sine wave values and then just seek into it based on time. More memory usage of course, but it's a trade off you can sometimes make. Think of it like wavetable synthesis for LED animations. :)

FetusPorn
Jul 7, 2003

WUGT: Creatures attack and block as normal, but none deal any damage during combat. All attacking creatures are still tapped. Use this ability any time
That's a very good point. I had cobbled together a couple of things and I never bothered to revisit how 'count' was called... I'll have to keep that in mind next time I have a restricted value (which is pretty often)

I take this to mean that if you set "byte count=255;" and then you "count++;" count is now 0? That saves a lot of screwing around.

I've only just dipped my toes into the stuff beyond the higher level Arduino commands, this kind of tip is very helpful.

Thank you!

Sagebrush
Feb 26, 2012

FetusPorn posted:

I take this to mean that if you set "byte count=255;" and then you "count++;" count is now 0? That saves a lot of screwing around.

Yep. byte is an unsigned 8-bit integer, meaning it can store values from 0 (b00000000) to 255 (b11111111). Add 1 to 255, and it rolls back over to zero just like an odometer.

A signed integer uses the first bit to represent the sign, so an 8-bit signed int can store values up to 127 in the lower 7 bits, and then flip it negative with the upper bit. Add 1 to 127 and it rolls over to -127. (Note that this is still 256 total values, so you're not gaining or losing anything -- it's just for convenience)

A byte is pretty much always going to be unsigned 8 bits, but the other names like int, char, long, etc. can vary depending on the system's word length. If you get really into bitwise operations, it can be handy to use the more explicit declarations for your variable widths:

code:
int8_t alpha = -69;		//signed 8 bits
uint8_t bravo = 219; 		//unsigned 8 bits
int16_t charlie = -1337;	//signed 16 bits
uint16_t delta = 8008;		//unsigned 16 bits
and so on. widths of 8, 16, 32 and 64 correspond to the arduino types char/byte, int, long, and long long.

Foxfire_
Nov 8, 2010

That is not how signed integers work on anything remotely modern.

Signed integers are stored in two's complement format. The most significant power has an implicit minus sign:

i.e. 11110000 = -1*2^7 + 1*2^6 + 1*2^5 + 1*2^4 + 0*2^3 + 0*2^2 + 0*2^1 + 0* 2^0 = -16

0x7F = 127 = most positive int8_t
0x80 = -128 = most negative int8_t

This makes the circuitry simpler and avoids having distinct bit patterns for positive and negative zero.

Also, in C and its derivatives, signed overflow is undefined.

(int8_t)127 + (int8_t)1 = :frogout:

The compiler is designed assuming it never happens (e.g. it will assume (x + 1) > x). What exactly happens is unpredictable depending on compiler, context, etc...

Sagebrush
Feb 26, 2012

I debated whether I should explain it the way I did, which is not technically accurate but makes perfect logical sense to a newbie who is being introduced to the concept of rollover, or get into two's complement arithmetic. I figured no one would really bother arguing the point and it would be better to simplify things. Welp

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Foxfire_ posted:

That is not how signed integers work on anything remotely modern.
He says, talking about 8-bit microcontrollers.

quote:

The compiler is designed assuming it never happens (e.g. it will assume (x + 1) > x). What exactly happens is unpredictable depending on compiler, context, etc...
Which is extremely well-defined on the atmega 328p, at the heart of the arduino platform. The difference between (short) and (byte) is optional settings so the compiler can check for the under/overflows. If you don't put those on, then the two types behave the same, where it's on the programmer to care or not care about overflows, underflows, sign extension, etc.

We're in the world of tiny, low-memory devices. Turn all the flags off and pretend like it's 1986 again.

Foxfire_
Nov 8, 2010

"remotely modern" meaning designed after the mid 60s. Sign and magnitude went away very quickly.

Signed overflow is defined in the hardware (part of the point of 2's compliment is that there is no difference between signed and unsigned arithmetic), it is undefined in the language.

Compilers will happily take a program like this:

code:
int8_t a = 0;
while (1)
{
    a += 1;
    if (a == 0)
    {
        break;
    }
}
and turn that into an infinite loop because (a+1) can be assumed to be > 0 forever, so the if is always false. Some compilers offer flags to take on extra guarantees, but that's an extra thing you'd need to turn on.

For a tl;dr on the rules without worrying about why:

pre:
uint8_t  goes from       0 to      255, overflow wraps around
uint16_t goes from       0 to    65535, overflow wraps around
uint32_t goes from       0 to (2^32)-1, overflow wraps around
int8_t   goes from    -128 to      128, you must ensure no overflow
int16_t  goes from  -32768 to    32767, you must ensure no overflow
int32_t  goes from -(2^31) to (2^31)-1, you must ensure no overflow

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Also, if anyone hasn't heard of twos complement and how it works, they should, because it's really cool.

wolrah
May 8, 2006
what?

Sagebrush posted:

I debated whether I should explain it the way I did, which is not technically accurate but makes perfect logical sense to a newbie who is being introduced to the concept of rollover, or get into two's complement arithmetic. I figured no one would really bother arguing the point and it would be better to simplify things. Welp
I mean this is the internet. Cunningham's law is truth.

When I'm doing that I tend to explicitly state that I'm oversimplifying it. I still sometimes get the "your analogy is bad" posts but at least we're all on the same page at that point (and sometimes those posts are actually helpful as a result).

Ambrose Burnside
Aug 30, 2007

pensive
I wanna tackle a project that'll require regularly getting sensor data from a remote station in the woods, about 15 metres away from a base station indoors. and publish it to a website- i'm good with most of that and have two Zigbee modules on hand that'll definitely be adequate for the ad-hoc network aspect, but I've never had to 1) choose an enclosure suited to long-term outdoor use in any weather condition, or 2) run a microcontroller off solar power. I'd like to complete the project within two weeks so mail ordering components is preferably avoided.
I was thinking about going to the local dollar store and grabbing a latching transparent plastic tupperware-type container for the enclosure, and buying some solar powered LED garden lamps to cannibalize for their solar cells + charging circuits + batteries (if I can find a purpose-made solar charger for devices I'd use that instead but i'm not holding my breath). I'd also grab some silicone sealant to waterproof the required wire passthrough for the sensor, and maybe make a better gasket for the enclosure. Ideally I want to keep the solar cells inside the enclosure, still drawing power from the light passing through the lid, so nothing on that end needs to be separately waterproofed.

Does all this sound reasonable? Particularly the solar charging stuff? I've never powered a project this way so i'm kind of hoping the solar charging circuits I'm apt to find at the dollar store can be easily adapted to powering a dev board (I have a Nano, Uno, Mega and ESP32 to pick from) that has to check an ultrasonic rangefinder once every 30 minutes and transmit that data to a conventionally-powered base station- but I don't actually know if that's the case. On the enclosure end I'd ideally use a transparent Pelican-type case actually made to be waterproof, but tracking one down at a brick and mortar is likely to be a problem.

Rapulum_Dei
Sep 7, 2009
A good tuperware tub with a click on lid and gasket would be just as good as a pelicase at keeping the water out imo. Thow a couple of silca dessicants in as well for any condensation.

edit: Definately use gromets for the cables

Rapulum_Dei fucked around with this message at 18:06 on Jun 5, 2020

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
It can work but it might be harder than you think to get it really waterproof, especially if you have to cut into the case for things like running cables in and out. I'd try to track down a little pelican case, you don't need the real deal name brand and a clone found for cheap on amazon would be fine. I think places like Harbor Freight even sell cheapo knockoffs.

For getting wires in and out, make your life way easier and think about using waterproof grommets like these: https://www.amazon.com/GiBot-Cable-Glands-Waterproof-Protectors/dp/B0748JLNR4/ref=pd_lpo_200_t_0/146-2043358-9211320 This way you just drill a little hole (christmas tree bits are best for this: https://www.harborfreight.com/2-piece-titanium-nitride-coated-high-speed-steel-step-drills-96275.html ) and put the grommet on and wire through it vs. drilling a hole, trying to seal it up with some horrible epoxy, thinking it's perfect and putting it out in a rainstorm, then finding out there's a giant puddle of water inside after the seal failed.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Doing low power / current sipping is also really tough. But don't let that dissuade you, that's a case of "getting it going once, then see if it's good enough. Then, incrementally optimise the code until it works."


There are lots of kinda on settings / strategies you can use to help.

Ambrose Burnside
Aug 30, 2007

pensive
I’m temporarily living in a rural area with slow + intermittent postal service, even amazon shipments rarely arrive within the two week window i wanna finish this by, so i’m either using stuff i can source from the three (3) brick-and-mortar retailers nearby, stuff i salvage from the local dump, or not bothering at all, unfort. normally i’d just order a hobbyist-geared solar cell + charging circuit that i know will meet the power reqs and save myself the headache. an ideal solar power solution, waterproof grommets, the proper Pelican enclosure- not expecting to be able to round up any of those, hence my shittier improvised approaches

probably shoulda mentioned up front that i’m working under extremely silly Junkyard Wars-style sourcing constraints,, now that i’m thinking about it

e: for more context, this project idea is a thank-you for the people i’m living with currently, who have been having issues with their cistern and want to be able to check the water level remotely without having to physically crack the lid; recently a small animal fell in the cistern while the hatch was briefly open without anybody noticing until the water turned black and all the portable water was ruined (brushing your teeth with corpse water is bad, it turns out)- the idea is to let them check how much water is left in the tank even if they’re away from the property, so they can make sure their rainwater catchment system is operating as intended + so they never show up unawares to a house with no water
they’re pretty handy and self-reliant but not specifically electronics-inclined. it’s ok if this isn’t perfectly executed or needs some work because i expect them to be able to maintain or fix individual physical/mechanical issues with me providing a little remote guidance, like replacing the ultrasonic rangefinder if the lovely one i have on hand craps out- i kind of expect it to after some weeks or months, but once the system is shown to work they’ll furnish their own water-rated rangefinder- or replacing the enclosure down the line, etc. they couldn’t put this together from nothing by themselves, but once the whole system is in place and the code written they can probably improve and maintain most of it piecemeal.
i’m pretty sure there are commercial products that can do most of this out of the box, but like i said, the theme lately is Challenge Mode Electronics so i’m doing it partly for the experience along with the end result

Ambrose Burnside fucked around with this message at 18:57 on Jun 5, 2020

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


In that case, you're pretty well off. Water will wick up stranded cable, so make sure to silicone the actual cable end, and not just the passthrough. Try to get aquarium silicone so it's not off gassing vinegar into your enclosure. Desiccant packs also work really well. The enclosure is going to breathe moisture and get condensation eventually.

See if you can't find a solar fountain pump at the dollar store. The one I found had 500mA continuous un sunlight without draining the battery, and ran 30mA at night for the two weeks I was using it. I didn't even bother to optimize the code with that thing.

Forseti
May 26, 2001
To the lovenasium!
Any chance you can stuff everything into the housing of the garden lamp? Or do they just tolerate water rather than keep it out?

Rapulum_Dei
Sep 7, 2009
If it were me I’d be thinking esp32 running esphome and using deep sleep https://www.esphome.io/components/sensor/ultrasonic.html

If I were you I’d probably be thinking intricate custom preloaded filigree spring cantilever floating zigbee reed switch.

Rapulum_Dei fucked around with this message at 22:13 on Jun 5, 2020

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Yeah if you can get WiFi at the remote location I'd just stick an ESP in deep sleep, have it wake up every 30-60 minutes to send the data to the cloud, and go back to sleep. It should last over a year on a pair of AA batteries. You could also measure the battery voltage and transmit it along the level to let them know when to change the batteries.

Solar charging would probably be a pain in the rear end with lovely LED lamps. If I remember right, the ones I took a part a few years ago didn't even have a charging controller, the cell was hooked up directly to the battery.

E: comedy option: use the camera module to detect floating animals and send an alert

mobby_6kl fucked around with this message at 23:02 on Jun 5, 2020

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five
Dumb question: Is there any reason not to just put a float level stick through the lid?

If the lid is visible from somewhere convenient and it's not going to cause safety issues, it might be as simple as a chunk of pool noodle, a wooden dowel, and a short piece of PVC pipe to keep it vertical.

If you need non-line-of-sight info or something more precise, an electronic solution is probably the way to go, but I'd personally lean toward something as simple and mechanical as possible otherwise.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
He's trying to get remote sensing so they can check while they're not at the property

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

ante posted:

He's trying to get remote sensing so they can check while they're not at the property

I... completely missed that part. My mistake.

Ambrose Burnside
Aug 30, 2007

pensive

mobby_6kl posted:

Yeah if you can get WiFi at the remote location I'd just stick an ESP in deep sleep, have it wake up every 30-60 minutes to send the data to the cloud, and go back to sleep. It should last over a year on a pair of AA batteries. You could also measure the battery voltage and transmit it along the level to let them know when to change the batteries.

Solar charging would probably be a pain in the rear end with lovely LED lamps. If I remember right, the ones I took a part a few years ago didn't even have a charging controller, the cell was hooked up directly to the battery.

E: comedy option: use the camera module to detect floating animals and send an alert

the cistern is out of range of the wifi network, as far as my phone is concerned- i can intermittently detect it but haven’t been able to really do any browsing or downloading at that range. i’d prefer to skip the whole zigbee remote-base double-microcontroller scheme if possible but it seems like the path of least resistance alongside “buy a wifi repeater just to [hopefully] extend coverage to the cistern” or whatever.

either way, aiming for a power-sipping design and running it off batteries sounds like the way to go, if i can get at least a month or two of intermittent operation between charges. could even grab a dollar store power bank for the 18650 cell + charging circuit. should probably go with whatever common battery type offers the lowest self-discharge and the best performance at low temperatures, given the application


e: come to think of it, i’ve also got a few FS1000A 433mhz wireless transmitter/receiver module pairs on hand; i’ve never used them before but they’re definitely a better fit than the zigbees, seeing as how the operating range is greater and i just need the simplex communication they offer vs the mesh local-network thing zigbees seem geared towards

Foxfire_
Nov 8, 2010

You could try a directional antenna for wifi. If an omni antenna in a phone is marginal, something with more gain might work

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Give it a shot first though, these modules can get pretty silly range even without an external antenna, but if yours has a connector that's even better. For low power operation also keep in mind that all the extra crap like LEDs or serial adapter on the dev board, if you're using one, can use more power than the chip in deep sleep so you might need to disable what you don't need.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Ambrose Burnside posted:

solar powered LED garden lamps to cannibalize for their solar cells + charging circuits + batteries (if I can find a purpose-made solar charger for devices I'd use that instead but i'm not holding my breath).

This can't be answered without sticking a multimeter on them and seeing if they meet your requirements for your project. Trivially fast and cheap to do so, though.

In applications like this, power is often the thing that drives how often you can turn on your low power devices for example.

Dominoes
Sep 20, 2007

mobby_6kl posted:

Has anyone used a cheap Chinese PH probe like this one? I'm considering getting one to IoT my aquarium and/or aquaponics. But besides reliability and accuracy, can it even work just inserted into the water, or does the water sample it need to be for whatever reason in that little cap?


A bit old, but...

I have a similar chinese pH probe. The cap contains a 4M potassium chloride solution used to keep the ion concentration in the probe stable during storage; the probe contains a similar solution inside its glass bulb. You can mix this yourself with water to the right concentration, or buy pH storage solution. Leaving the probe stored in some type of water solution for long periods may or may not be OK, depending on the probe. Leaving it dry will damage the probe. Leaving it in a KCl solution is optimal.

I do have that module, but wasn't able to get it working, after minimal troubleshooting. I've been using a custom-designed one. Let me know if you'd like the design; it's mainly 2 op amps, and ADC, a temp sensor, and software side processing to generate pH from voltage and temperature.

What's your experience been like re sensors etc for aquaponics?

Dominoes fucked around with this message at 20:03 on Jun 10, 2020

mobby_6kl
Aug 9, 2009

by Fluffdaddy

Dominoes posted:

A bit old, but...

I have a similar chinese pH probe. The cap contains a 4M potassium chloride solution used to keep the ion concentration in the probe stable during storage; the probe contains a similar solution inside its glass bulb. You can mix this yourself with water to the right concentration, or buy pH storage solution. Leaving the probe stored in some type of water solution for long periods may or may not be OK, depending on the probe. Leaving it dry will damage the probe. Leaving it in a KCl solution is optimal.

I do have that module, but wasn't able to get it working, after minimal troubleshooting. I've been using a custom-designed one. Let me know if you'd like the design; it's mainly 2 op amps, and ADC, a temp sensor, and software side processing to generate pH from voltage and temperature.

What's your experience been like re sensors etc for aquaponics?
Thanks, this is very helpful. For this use case I was just hoping to stick it in the water and just read the value as needed, so... it might be fine. Unfortunately the usual suppliers don't provide much in a way of documentation.

I haven't actually bought the probe yet, but yeah if you have the circuit available somewhere, that could be great to have in case theirs doesn't work.

Actually I haven't started with aquaponics, figuring this out was part of the planning. I am growing stuff in soil for now, and I've been using a capacitive moisture sensor and thermocouple to keep an eye on soil moisture and temperature. The former would be pretty much useless for aquaponics, I imagine :)

Dominoes
Sep 20, 2007

Cardiac
Aug 28, 2012

So I have been playing around with making a green house monitoring device which uses a stepper motor for opening the lid.
Anyways, I basically have it working and it just needs to be setup for outdoor use. For that purpose I got a IP44 rated power supply that outputs DC 13.5V with 1.5 A.

When putting my device together, I used a power supply that could be switched between 12-5V with 1A and everything works as intended with this one while using 12V output.
With the new power supply however, my device just does not react and I don’t get the sounds I expect from the stepper motor. Should there be such a large difference just for 1.5V?

I plugged the power supply into an Uno and could read 14V in, so the power supply should be working.
Any ideas on what to test or should I try to reduce the input voltage?

Late edit.
I am a moron and didn’t check the voltage inlet which apparently was opposite to the 12 v input.

Cardiac fucked around with this message at 19:41 on Jun 28, 2020

deoju
Jul 11, 2004

All the pieces matter.
Nap Ghost
I’ve wanted a full ghostbusters kit for most of my life, and now I’m pretty close to completing one. I’ve got the uniform, the goggles, the PKE meter, and the proton pack. But I still need the trap. I bought one of the Rubies traps from Walmart. For $20 bucks it's great, actually. But it still isn’t good enough for me. For starters, it definitely looks like a toy. So I took it apart, repainted it, and added some aesthetic pieces. It’s looking a lot better, but the electronics still suck. The sounds are wrong and too quiet, the lights are dim and some are missing. And the pedal looks nothing like the real one. And there’s no smoke. However there is a motor and gear system which acuates the trap doors, that part works really well.

To get what I want I’m going to need a compact system that can…
-Run lights
-Play sounds
-Operate the motor
-Toggle a modified vape pen on and off.
-Do all this in a programmable sequence.

I’m new to this poo poo, but that sounds like a job for an arduino right? I’m willing to fiddle and gently caress around, and I’ll watch as many youtube tutorials as it takes to figure out how to program the thing. But I don’t know what hardware to buy. I figure I need…

-The Arduino.
-Lights that are pretty loving bright for when it’s open (“Don’t look directly at the trap!”), but that won’t overheat when turned on for 15-20 seconds. A slightly purple tinge would be nice too.
-A speaker that is loud enough to turn heads in a big room.
-Something to make sure the arduino gets the right amount of power to the existing motor. Dunno how resistors and that poo poo works.
-Some vape pens. There are lots of cosplayer videos on how to jerry-rig these things. Not too worried about these.
-A yellow colored bar graph approximately an inch and half long.
-A blinking yellow LED
-A blinking red LED
-A way to remotely activate the trap from the pedal. The cosmetics of the prop make this a little more complicated. The cable that runs between the trap and the pedal is connected by pneumatic quick-connects. Since those are airtight, I can’t run wiring through them. I could maybe drill holes, but I’d like to be able to disconnect things. Fortunately the trap is made up of two project boxes, so that helps. I was thinking bluetooth for this.
-A good switch for the pedal. I tried a guitar pedal switch, but it doesn’t travel enough. I want satisfying feedback when you stomp on it.
-A switch to turn this fucker on and a battery to power it.

Here’s links to the two best scenes of them being used…
https://youtu.be/BcYJmZKHaGU?t=170
https://youtu.be/y7eZAFM4FLY?t=277

Rapulum_Dei
Sep 7, 2009
https://www.therpf.com/forums/threads/walmart-ghost-trap-and-pedal-build-finished.332696/ Might be useful

Ambrose Burnside
Aug 30, 2007

pensive
If I want to use a microcontroller as a USB peripheral and not tear 100% of my hair out it's ATmega32u4 boards or bust, right? I don't have any experience with them so which should I go with, assuming this peripheral is gonna involve "a lot" of buttons and switches (it's a Kerbal Space Program controller)? My first inclination is a Sparkfun Pro Micro b/c I like their products and support, but I suspect I'll need way more than 12 DIOs; is a Leonardo a better fit?

Ambrose Burnside fucked around with this message at 19:16 on Sep 28, 2020

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Teensy?

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

Ambrose Burnside posted:

If I want to use a microcontroller as a USB peripheral and not tear 100% of my hair out it's ATmega32u4 boards or bust, right? I don't have any experience with them so which should I go with, assuming this peripheral is gonna involve "a lot" of buttons and switches? My first inclination is a Sparkfun Pro Micro b/c I like their products and support, but I suspect I'll need way more than 12 DIOs; is a Leonardo a better fit?

If you just need more inputs you can get parallel to serial shift registers that will let you pull in a crapload of button presses over I2C.

My go-to for building USB peripherals has been the Arduino Micro (which does use the 32u4) but I'm probably migrating to the Teensy platform because it's got way more capability (like high bit depth PWM) and the price increase is negligible for my use cases.

Sagebrush
Feb 26, 2012

Teensy is the way to go yeah. A Teensy-LC will handle nearly anything you can imagine doing with a homemade USB device and it costs 11 bucks. It also has the best USB stack for writing custom devices (still not easy to do, but better than other options).

The absolute cheapest Arduino USB device board would be the $2 STM32 Bluepills but those things are tear-your-hair-out PITAs to get working. Once they're running they're fine but the toolchain suuuuuucks

Ambrose Burnside
Aug 30, 2007

pensive
I've basically overlooked Teensys so far (along with ARM Cortex-based stuff in general, idk why), they seem like a perfect fit and basically cost the same as the alternatives, so I think I'll go that way, thanks.

The LC seems like it's just a lighter-weight version of the standard Teensy, I take it none of the missing/downgraded features are important for a USB peripheral?

Ambrose Burnside fucked around with this message at 19:31 on Sep 28, 2020

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

Ambrose Burnside posted:

I've basically overlooked Teensys so far (along with ARM Cortex-based stuff in general, idk why), they seem like a perfect fit and basically cost the same as the alternatives, so I think I'll go that way, thanks.

The LC seems like it's just a lighter-weight version of the standard Teensy, I take it none of the missing/downgraded features are important for a USB peripheral?

There's a breakdown on prjc.com/teensy/teensyLC.html of the features that are missing between the LC and the 3.2.
If you're using it as an HID and not for a serial connection you shouldn't have any real losses.

Sagebrush
Feb 26, 2012

Ambrose Burnside posted:

The LC seems like it's just a lighter-weight version of the standard Teensy, I take it none of the missing/downgraded features are important for a USB peripheral?

It depends on what you're trying to do with USB. For basic IO devices no, you won't have any problems using an LC. For instance I have used them to make custom flight sim joysticks, where all they need to do is rapidly read from a bunch of buttons and potentiometers and encoders, do some basic data formatting, and push it up the pipe at 100Hz. For that they're perfect. They even have enough power to run real-time kalman filters etc to smooth out the inputs.

If you're planning to make, idk, some sort of USB camera or music device or something else where you need to process large amounts of data in real time, then yeah you might want to upgrade to the fancier boards that have FPUs and such.

Adbot
ADBOT LOVES YOU

Ambrose Burnside
Aug 30, 2007

pensive
Nah, it'll be pretty similar to your joystick, although I'd also like to be able to receive data from Kerbal and display it on a 7-segment display (there's a plugin that apparently makes this relatively painless); Still sounds like a good fit for the LC, I don't think accepting telemetry data and driving a segmented display about it adds much computational work.

(tell me this isn't just the bee's knees)

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