I did the beginner LED exercises. But, then I moved on to a more complicated one involving external batteries, servos, motors and bluetooth modules. I learned a lot, but got in over my head and couldn’t troubleshoot at a certain point.
What types of projects (and what order) should I focus on as a beginner to build a solid foundation.
You have to pick a direction. Where did you get lost? There is no "preferred" track beyond what interests you. I did some basic checks and then built THIS:
Your topic has been moved to a more suitable location on the forum. Introductory Tutorials is for tutorials that e.g. you write, not for questions. Feel free to write a tutorial once you have solved your problem
It's also worthwhile to analyze your mistakes. If you repeatedly fail, or struggle, with something, then you need to revisit that topic and improve your understanding. If you decide you don't understand arrays, for example, then either search for an array tutorial, or ask here, in the programming questions category, and I'm sure someone will help.
Read read read code, closely, so you can be sure of what it does and how.
These fora are good for that. Skip stuff that is clearly over your head, or on the other hand already in your firm grasp.
All that reading, especially maybe reading code, will no doubt help you create a list of interesting things you'd like to do youself, as well as the pesky details of the actual code involved. And the top ten problems that appear here with dismaying regularity.
It sounds like you tried to do too much at once. The trick with such projects is to find a small piece of it and get that working before you move on. Big bang testing is too painful.
It is also worth looking at debugging techniques , such as using print , so you can see the value of variables or check the program runs through sections you thought it should .
Or power a LED on and off every time some function is run - Both give you an insight into how things are running .
Following the elephant bit .. if you write code for a little part of a project , test it , then for another part , test it ….rather than trying to write the whole thing in one go , it’s easier .
It’s useful to sometimes develop some of the examples for this or even build up your own library of small sketches that work and can be used when needed .
Coding is, and always will be logical, so definition and debugging are always finite problems that can be broken down to their smallest events.
Hardware has ‘invisible’ variables that can only be perfected with understanding of the base components…. voltage, current, frequency, time etc.
If your software restarts because of voltage spikes, or too much current being drawn by a motor… there’s no meter, orSerial.print that can help, so your faulty hardware build will ‘never’ work. You can guess,mand fudge, but if it gpfails on the next cold day, or when the second output is active - you’re back to square one.
This is the beauty of simple building and learning blocks like Arduino - it ensures the basic code environment has a proven space to run reliably, but as soon as you add lights, switches, solenoids etc, that safe playground means nothing - you’re trying to tow a thirty foot boat with a Fiat 500. It’s not going to work for long, despite the Fiat being a great little car.
The Fiat runs fine if you top it up with fuel and water, so does the boat, but to work together needs a bit more thinking.
Thank you, this is exactly what happened to me. Can you suggest where to begin learning about hardware? I really don't know much about any aspect. At this stage, I'm just trying to replicate other people's projects and I run into problems. (FYI I'm nearly finished with the Arduino Beginner Guide.)
It has all mostly been said but I think also that a practical approach is good in that you pick successively more complex projects. Learn to divide a large project into smaller, separately testable units. If you get stuck somewhere, post a request for help showing you code and schematics. Gather knowledge, at least at the beginning, on an "as needed" basis as an alternative to systematically working through a C++ book or an electronics book. That way it is much less abstract.