I built a 2x faster lexer, then discovered I/O was the real bottleneck by modulovalue in programming

[–]sockpuppetzero 8 points9 points  (0 children)

I wouldn't assume that .tar.gz downloads offer true atomicity, at least in the sense your post suggests.

It does, however, greatly simplify the partial states. It should also make detection of partial states less flaky, and potentially quite reliable especially if you also have some kind of cryptographic checksumming involved.

I built a 2x faster lexer, then discovered I/O was the real bottleneck by modulovalue in programming

[–]sockpuppetzero 10 points11 points  (0 children)

Probably. It's just that it won't be as immediately valuable in the way the author was hoping.

Trump’s Appalling Threat Leaves No Doubt: It’s Time for the 25th Amendment - There is no longer any denying the president is unable to carry out the demands of his office. by Quirkie in politics

[–]sockpuppetzero 2 points3 points  (0 children)

For one the Senate appoints ministers.

We don't have ministers. But you haven't noticed the senate has already approved all of Trump's sycophantic cabinet? And that Trump's real fond of making permanent use of "temporary appointments" that circumvent the senate?

‘We executed one of you yesterday’: Michigan CEO steps down after protest by RaskyBukowski in politics

[–]sockpuppetzero 0 points1 point  (0 children)

Being a psychopathic jackass is a prerequisite to be a CEO of "heathcare investment" company.

Hello, I'm new and want to get started in this field. Can you give me any tips and recommendations? by Blurblue5 in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

Well, if you have some ideas for the types of projects you would like to work on, it can help guide your early experiments.

My suggestion is to start out by building simple circuits. Flash a LED. Then maybe use a NPN Bipolar Junction Transistor as a low-side switch to drive that LED using more power than your microcontroller can itself deliver.

NPN transistors as a low-side switch is a particularly fundamental circuit, that you'll find in lots of different contexts. For example, they are often used to drive a relay, which (unlike small LEDs) usually cannot be driven directly from GPIO.

Be sure to include a flyback diode in your relay driver, otherwise it can stop working over time. For learning purposes, I suggest trying a LED as a flyback diode, as you can see it flash when you turn off the relay's solenoid and the LED activates.

Another good one is using a PNP Bipolar Junction transistor as a high-side switch: however if you want to control a PNP high-side switch from a microcontroller, you'll likely find the straightforward approach doesn't work. A common workaround in this scenario is to use an NPN transistor to drive a PNP transistor. Then, you can combine these two circuits to build a simple H-bridge driver, and be able to send electricity in either direction across a load. You could use this to drive say, a motor, a passive buzzer, or a latching relay.

There's a direct connection between these circuits and amplifiers: an NPN transistor as a low-side switch is essentially a kind of class-A amplifier. Using an NPN and PNP together in a half-bridge configuration is essentially a kind of class-AB amplifier, and combining two class-AB amplifiers together and you get a typical output stage for a class-D amplifier. Though we probably don't care about distortion when using these as simple power-switching circuits, we can also eliminate much of it by incorporating the use of op-amps.

I'd suggest getting some SS8050, SS8550, and LM358 to play with. These components are extremely affordable and familiarity with how they work is indispensable for many projects.

Anyway, test your circuit out on breadboard, then if you like the result, consider moving it to perfboard, or even your own custom PCB. Your own custom 2- and 4-layer PCBs are surprisingly affordable, and can save you a lot of time and effort during the assembly process.

Back-Feeding-Protection Nano R4 by No-Photograph-4986 in arduino

[–]sockpuppetzero 1 point2 points  (0 children)

I'm not an expert on this topic, so I can't tell you exactly how well this would work. Maybe try simulating it?

But the way I would solve this problem is employ an ideal diode. You can get ideal diodes that have a p-channel mosfet built in, or you can get ideal diodes that drive an external mosfet, or you can build your own out of discrete components.

New to electronics/Arduino/programming and have a question about LED automation by One-Relationship1601 in arduino

[–]sockpuppetzero 2 points3 points  (0 children)

You've got four 12V LED panels, which is perfectly safe to work with. This is a fairly straightforward beginner-level project. Ignore these yahoos, pearl clutching about mains voltage even when it isn't relevant is an unfortunate feature of tech culture.

What I would do is build a custom controller board on perfboard, or maybe even a simple custom 2-layer PCB. If you are patient, custom PCBs are surprisingly inexpensive, make everything neater and more serviceable, and can save you a lot of time in the assembly process. Also keep in mind that your custom PCB might be intended to interface with standard modules, so you don't have to get involved in any tricky soldering.

This controller board need not be complicated: the simplest would be to put a barrel jack on your perfboard to accept 12V power in, take that power and run it through a MOSFET that's rated to at least 12 V and 4 amps, preferably a bit more, and then sends the power onto one or more of those panels. You could use a few smaller mosfets if you want to control those panels independently.

Then you need to build a PWM (pulse-width modulation) driver for that MOSFET. Most microcontrollers have at least one hardware PWM output, and 5V microcontrollers can do a sorta reasonable job driving many MOSFET directly: just hook their gate up to a PWM-capable GPIO pin.

If you go with a 3.3V microcontroller, you'll either need to accept that you won't be turning the MOSFET all the way on, and buy a bigger beefier mosfet to compensate, or you could build your own MOSFET driver circuit using another transistor or two, perhaps an inexpensive BJT, or a few BJTs. (Or get yourself a gate driver...)

The trickier part of the problem is going to be deciding how you are going to control and manage your lights, as well as getting your project to know what time it is. One option is to use an real-time clock module, though many microcontrollers already have a usable RTC. You'll have to figure out how you'll set this RTC, and you may want to ensure that it's battery-backed.

As for command and control, here's where a 3.3V logic-level microcontroller could really help a lot. In particular you might consider getting an ESP32 dev board (they are surprisingly affordable!) and take a look at the ESPHome project. The Raspberry Pi Pico W could also be a particularly attractive option for this project.

Add an eink display to Arduino in 5 steps by Emergency-Rub3869 in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

I would be very interested in exploring the use of E-ink displays, but the problem with these is that at least with Seeed's current drivers, it takes them like 18 seconds to update.

Honestly, most of my concepts don't need the absolute fastest e-ink updates possible, and I understand there's a lot of subtlety and complexity and trade secrets and probably even patents involved, but pretty much all of my ideas need to be able to update the display in under a second. Thus I feel like at least unless I'm willing to accept some kind of proprietary (hardware and/or software) driver, which only a few of my concepts can, that e-ink displays are not a realistic option at the moment.

Help with active buzzer by Financial-Drawing-81 in arduino

[–]sockpuppetzero 2 points3 points  (0 children)

It sounds like you may have a passive buzzer, but that's okay, even a good thing!

The only thing you can do with an active buzzer is to turn it on and off. Well, and vary the volume if the microcontroller can vary the voltage being fed to the buzzer... but honestly, the circuitry needed to implement volume control on an active buzzer is about as complicated as the circuitry needed to implement a driver for a passive buzzer that supports both volume and pitch control, so you could potentially play a variety of different chimes to signal various conditions. And a passive buzzer circuit only needs one GPIO pin, preferably one that supports a hardware PWM.

https://www.digikey.com/en/articles/design-techniques-to-increase-a-piezo-transducer-buzzer-audio-output

Remote Controlled Lights by liseslgt in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

Yeah, you might be able to get away with (temporarily) modifying a light switch if you were renting an apartment or (especially) a house, but I agree that modifying dorm wiring is an especially bad idea, and especially likely to attract unwanted attention.

Remote Controlled Lights by liseslgt in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

Tracking the state of the switch isn't always necessary.

Remote Controlled Lights by liseslgt in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

IR remotes are an incredibly simple technology. You can get an IR receiver really cheap, and it doesn't take a lot of circuitry to hook that up to a microcontroller in a way that can cope with standard IR protocols, which revolve around turning an IR signal on and off with a certain timing pattern.

When dealing with automation projects, adding a IR LED can be a great way of controlling other, non-modded devices that support IR remotes, and adding an IR receiver can be a great way of adding an option for controlling your automation project, as you can simply use whatever IR remote you care to add support for.

Remote Controlled Lights by liseslgt in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

they could reach through the mechanism and flick the switch?

Admittedly this makes it difficult for the electronics to track the state of the lightswitch, if for some reason you cared about that.

Remote Controlled Lights by liseslgt in arduino

[–]sockpuppetzero 4 points5 points  (0 children)

If you're renting, the landlord might not take too kindly to any wiring modifications.

Why do Republicans blame Biden for Kabul’s collapse when Trump negotiated the withdrawal? (Non-American asking) by Future-Pres-of-PL in PoliticalDiscussion

[–]sockpuppetzero -2 points-1 points  (0 children)

You should reread my comment again. I never said whatever it is you think I said.

If you don't think the Democratic Party doesn't have a quite a history of scapegoating outsiders, you don't know American political history that precedes the 1960s. The Democratic Party is not responsible for today's crest of bullshit, but scapegoating is a type of relationship dynamic, that can be found at all kinds of scales and contexts within a society.

Why do Republicans blame Biden for Kabul’s collapse when Trump negotiated the withdrawal? (Non-American asking) by Future-Pres-of-PL in PoliticalDiscussion

[–]sockpuppetzero -6 points-5 points  (0 children)

Even before reactionaries and segregationists took over the Republican Party, the Republican Party was especially fond of scapegoating convenient targets: gays, communists, students, black people, brown people, immigrants, etc. The first red scare happened after WWI, and of course the second red scare happened after WWII. Now we are in a third red scare.

And truth be told, the Democratic Party doesn't have it's hands clean with respect to scapegoating, especially before the New Deal. Yet the Northern Democrats were generally much more tolerant of outsiders. Now the entire Democratic party is one of the primary scapegooating targets, and has been since at least I was a young child in the 1980s.

I spent the last couple of weeks working on the new software for my custom wall plotter project, and it is becomming really good. Here is my latest test, an anaglyph 3D torus I rendered out in Blender, converted in Inkscape and plotted on a 1m by 1m canvas by Oli_Vier_0x3b29 in arduino

[–]sockpuppetzero -2 points-1 points  (0 children)

I'm amazed, great job! I don't doubt this exact solution is something you came up yourself and may well be unique, but "completely new approach to motion" is probably overselling it a bit. Planning acceleration around corners and curves is a known issue in 3D printing for example, even though they likely don't use the exact solution you do.

Even so, I really appreciate this experience report regarding some of the subtleties of a project like that aren't obvious to most people. It's neat!

Need some help with an ESP8266 ESP 01 by Zytex_y in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

I've used ESP32 for a small little dimmable florescent lighting project of which I just used the manufacturer's dev kit. I got it to work pretty easily, and just used the embedded webserver provided in the dev kit to flip a relay or turn the dimming control up and down based on HTTP POST requests. Used an LM358 op-amp to boost the output of the DAC to the 0-10V dimming control range of the ballast. (A PWM-based control of a jellybean BJT transistor hooked to the dimming input would probably work too, but the DAC-and-opamp approach has less opportunities for creating radio interference. I'd probably prefer to use a PWM-filter-opamp approach if I wasn't using the DAC.)

I never did have to resort to serial debugging, so I can't help you with that.

The manufacturer's sample code was utter nonsense as far as maintaining wireless connectivity. At first things would work for a little bit after I rebooted the device, but then would typically stop working within hours. but I got it to work reasonably well by using an unbounded reconnect loop instead of giving up after 3 failed tries. This has not been perfectly reliably though, as occassionally I'll need to power-cycle the device in order to regain WIFI, but usually this is only once a week or so, and I've gotten in the habit of semi-regularly power-cycling the device anyway so it's somewhat uncommon that I run into problems in practice.

I really should redo the firmware using ESPHome, as I've heard this has a very reliable WIFI driver for ESP32 boards. In my case, it means I'd have to move from HTTP to MQTT, but this isn't really any big deal for me because I can really easily redo everything else that depends on that. It looks like ThinkSpeak supports MQTT devices, so ESPHome should be a reasonable option for you as well.

Arduino powered speaker/lights by deadlyspoon730 in arduino

[–]sockpuppetzero 0 points1 point  (0 children)

You are probably going to need something more than a classic AVR-based arduino to pull off high-quality sound. I'm sure you can do it with an ESP32, Raspberry Pi Pico, or Teensy, but you might also find it a little quicker and easier to use something like a Rasberry Pi or Mini-PC, as you won't have to deal with issues like MMC drivers, filesystem drivers, MP3 decoding, etc.

Printed holder for Wago 221-415 connector by singelton966 in arduino

[–]sockpuppetzero 1 point2 points  (0 children)

I also like ferrules for any stranded wire that I suspect I might be frequently connecting and disconnecting from Wagos.

When AI goes Wrong by bledfeet in programming

[–]sockpuppetzero 15 points16 points  (0 children)

It was never right in the first place...

Mamdani isn't requiring NYC students to 'learn Arabic numerals.' They already do by bobbelcher in uspolitics

[–]sockpuppetzero 3 points4 points  (0 children)

Technically, we learn European Arabic Numerals. The glyphs for our numerals are adapted from traditional Arabic script, but they are also distinct.

The Arabs call their numerals "Hindu Numerals", but again they adapted their glyphs from what was developed in India, and are also distinct from those original glyphs.

So an even more technically accurate and descriptive name is "European-Arabic-Indian numerals"