3 ms·
Yeah, never understood why I would want an entire OS running just to blink an LED. I was going to make a pro-Arduino comment but I guess my LED example warrants
by JKCalhoun 7mo ago
Yeah, never understood why I would want an entire OS running just to blink an LED. I was going to make a pro-Arduino comment but I guess my LED example warrants little more than an R/C circuit and a transistor, ha ha.
(Anyway, I still remember the thrill of writing assembly for a 68HC11 and getting a pair of hobby servos to respond.)
- bombcar 7mo agoFamiliarity - it’s easy for us Linux dweebs to build a pi that can flip an LED, but programming an arduino is an entire new area.
- jfim 7mo agoIt's pretty trivial to do so on Arduino though. void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); }
- KPGv2 7mo agoWell first you have to learn the Arduino programming language. And the stdlib.
- telotortium 7mo agoGood thing LLMs exist now
- grogenaut 7mo agoit's literally the hello world of micros. get an arduino, plug it into the usb, install the ide, new -> example -> 01. Blink. Press Run. Cool you have now blunk a led. Now use AI to draw the rest of the owl.
- bombcar 7mo agoIt's easy once you've done it - but before you've done it (for me at least) it was much easier to just install a Linux on a Pi and run a bash script than to learn how to program an Arduino. (Of course, there are those to whom an Arduino is an overpriced piece of junk and they don't understand how I can't solder a three cent chip myself.) But let's be realistic - all of these things are like my Steam library - purchases made but never used (I have a drawer full of Pis and other SBCs, and Arduino dev kits, etc. Someday I'll have time time time!).
- jfim 7mo agoIt's C++, and basically what Arduino gives you is int main() { setup(); for(;;) loop(); } As well as a GUI to easily flash devices and view the output from the serial port, as well as import libraries that do all of the hard work like say making a serial port on any microcontroller pin or control external devices like light strips or displays. I'd assume the average user on HN should be able to figure it out pretty easily.
- numpad0 7mo agoThey don't call it C++ because that sounds too difficult. But it's literally, not like a simplified subset that compiles into an IL using a formally proven tool, but as in literally compiled using GCC as, C++.
- extraduder_ire 7mo agoCalling it c++ might give the wrong impression to some people too, since it doesn't have the STL, rtti, or exceptions for boards like the Uno r3. It is c++ though. Just limited in similar ways to the US air force's requirements for using the language.
- grogenaut 7mo agogood news, now you can use all that dram you can't afford to vibe code an arduino program. Think of the savings and the learnings!
- tempaccount420 7mo agoYou're probably joking, but this is interesting. If we throw more RAM at AI, it can help us optimize programs to reduce our RAM needs, I haven't thought about it like that
- saidinesh5 7mo agoWith micropython or some of the js based frameworks for microcontrollers, it's really not that new/different.Especially with ESP32/Pi Pico W/their clones... In fact it's a lot more straight forward to not have to deal with Network Manager config files or systemd unit files or read only rootfs headaches of Linux world.
- NooneAtAll3 7mo agoasking as a casual non-poweruser... how does one do that on linux exactly?
- stackghost 7mo agohttps://www.kernel.org/doc/html/v5.0/driver-api/gpio/index.html https://www.kernel.org/doc/html/v5.0/driver-api/gpio/index.h... You can usually find libraries for your language of choice to speak GPIO and expose the pin's state as a variable in your code.
- saidinesh5 7mo agoMostly for the network stack. Economics, also, sometimes. These days, with ESP32, Pi Pico W etc... things have changed a lot. But before they got popular, Why deal with MCU + wiring some weird peripheral for wifi / ethernet when you get a Pi Zero W / Clone with built in wifi for the same price?
- stackghost 7mo agoFor me it's primarily the ability to run a full TCP/IP stack. For hobby projects, I'd rather use a Pi or a Beaglebone with IRC or HTTP for data egress than, say, I2C or SPI. The ease of debugging alone makes it worth it.
- rounce 7mo agoHow is this a barrier to using a microcontroller? I've sent http requests from many different microcontrollers.
- foobarian 7mo agoYou jest, but I ended up getting a lot of use out of being able to do this in software for a dimmable LED lamp. Dimming the LED required PWM, and the potentiometer resistance -> PWM frequency map ended up fairly intricate to make the knob "feel right." Now what I would have loved to have done is come up with some crazy analog circuit to implement an arbitrary transfer function from potentiometer input to LED voltage, but I didn't know how to do this at the time and the dev cycle would be a lot more painful than with software.
- JKCalhoun 7mo agoYeah, PWM on an Arduino is easy enough (no need for the Pi).
- dboreham 7mo ago68HC11 would have been a luxury for us.