5 ms·
Dumb question, but how do you learn to work/program for these things? any reading material I can look at? I started learning C this week and this looks very int
by sunsetSamurai 6y ago
Dumb question, but how do you learn to work/program for these things? any reading material I can look at? I started learning C this week and this looks very interesting.
- eru 6y agoHistorically one way people got into these was eg from learning how to program a Commodore 64 and other constrained hardware. I doubt that's the most efficient route these days, but it can still be fun. And there's lots of material on the likes of the Commodore 64. Oh, and of course there's always Google: 'but how do you learn to work/program for microcontrollers?' gets lots of hits, I bet some of them are even good.
- throwawaynothx 6y agoYou can start with a cheap ESP8266 dev board, which I believe is LUA. I made a button that just posts to a backend when we are low on milk in the kitchen for the office at work but you can do some crazy stuff. im sure there are some great books out there but a lot of people just learn by messing around and looking at other peoples tutorials online.
- tus88 6y agoThese things are little more than simplified Turing machines, so learn about them.
- cjsawyer 6y agoYou need a compiler/IDE, a programmer (device that you slot the chip into to to upload the code), and the datasheet. Past that googling starter tutorials and reading the datasheet will take you far!
- rahimnathwani 6y agoGet an ESP8266 or ESP32 dev board and go here: https://nodemcu.readthedocs.io/en/master/getting-started/ https://nodemcu.readthedocs.io/en/master/getting-started/ EDIT: Follow the better suggestion from harry8 below.
- harry8 6y agoIs it not much easier to just install the board support files in the Arduino IDE? Something like the ESP8266 R1 D1 from Aliexpress is like $3. https://www.aliexpress.com/item/33059632653.html https://www.aliexpress.com/item/33059632653.html I found that stupidly simple with many, many libraries to do things. WS2812 LED strips using FastLED is very popular and rightly so, great fun. Really quick and easy to start flashing lights in patterns. Then copy some wifi code so you can control it with your phone (or tablet or laptop). Mesh more than one. If you're just playing $3 is still very cheap. And if you've just started learning C being arduino compatible with many step-by-step tutorials a search away is gold.
- snvzz 6y agoIf it's for learning, price isn't as important. ESP8266 successor is ESP32. Also on Aliexpress, cheap and easy to get, ESP32-PICO-KIT and ESP32-DevKitC.
- embedawayz 6y agoYou can write ordinary C code to run on them. You just need a separate compiler/linker/etc. because they have a different CPU architecture than your computer. For an ARM Cortex-M chip, you can use the `arm-none-eabi` GNU toolchain: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads https://developer.arm.com/tools-and-software/open-source-sof... But when you write a program for a microcontroller, you don't have an OS kernel, so your code needs to include drivers for anything that you want to communicate with. It's a little outdated, but I like this introduction to STM8 chips (which this article also mentions) as a quick crash course on embedded C: https://lujji.github.io/blog/bare-metal-programming-stm8/ https://lujji.github.io/blog/bare-metal-programming-stm8/
- nerfhammer 6y agoterm is "cross-compiler" https://en.wikipedia.org/wiki/Cross_compiler https://en.wikipedia.org/wiki/Cross_compiler
- TechnicallyDan 6y agoHave a look at mBed - it's C++ rather than C, but it works with a wide range of boards / chips, many of which are cheap and has a solid range of libraries. I've used it mostly with STM32 boards. It uses the Arm compiler as standard, but can be switched to GCC https://os.mbed.com/studio/ https://os.mbed.com/studio/
- snvzz 6y agoFor learning and getting started, nothing beats the Arduino family. Huge and mature open ecosystem. And the advantage that dirt cheap clone boards exist. There's huge starter kits in Aliexpress at $10-$20 range, with an arduino uno or mega2560 clone included.