Ive been playing with my Arduino uno for about a few months now. The wiring is super easy and I can decipher and fix my mistakes no problem at all. I know I am still really new and have watched almost all Paul Mchorters tutorials. (sorry if I spelled his name wrong) No matter what code I seem to try and write from scratch I cannot make it work. Whether its misplacement of punctuation's (which I ussually can figure out). My question is where can I get more informations. I read forums and have a notebook full of notes and am still not getting it. Im not going to go to school for it as im just playing with it as a hobby. Thank you in advance.
Why don't you post some of the code that doesn't work and explain what you want it to do?
Then people can help you find the crux of the issue and recommend specific reading from there.
That tells me you need to work more on debugging skills. Do you always begin testing your code as you write it? Write one function, add in serial print of the variables and run the program. Do you see the printed values you expect. If no fix the problem right there.
Then add more logic to your program and repeat.
Do not EVER write what you think is a complete program without testing as you go.
Good luck,
Paul
There are some basic elements to grasp...
DECLARATIONS
DEFINITIONS
DATA TYPES (signed and unsigned)
SCOPE of variables
FUNCTIONS
-
as you get further along, you'll need libraries, structs{}, and arrays[]
-
understanding 'white space' is important. and don't forget those matching parentheses (, brackets [, and curly { braces - and those darn ; semicolons !
Learn about 'blocking' vs 'non-blocking' code to make your programs more responsive...
Then you can go on forever, there's always more to learn and understand.
Here is a list of pages for beginners put together by our @LarryD
Getting started:
Listing of downloadable 'Arduino PDFs' :
Either Google >>>- - - - > arduino filetype: pdf
Or
https://www.google.ca/search?q=arduino+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=arduino+filetype%3A+pdf&aqs=chrome..69i57j69i65.1385j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8
Listing of downloadable 'C++ PDFs' :
Either Google >>>- - - - > C++ filetype: pdf
Or
https://www.google.ca/search?q=c%2B%2B+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=c%2B%2B+filetype%3A+pdf&aqs=chrome..69i57.22790j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8
Arduino cheat sheet:
Watch these:
Arduino programming syntax:
Arduino arithmetic operators:
Arduino control flow:
Arduino data types:
Understanding Destructive LC Voltage Spikes:
OR
Why MOSFET gate resistors:
Some things to read
LCD information:
OR
Reading a schematic:
https://learn.sparkfun.com/tutorials/how-to-read-a-schematic
Language Reference:
Foundations:
How and Why to avoid delay():
http://playground.arduino.cc/Code/AvoidDelay
Demonstration code for several things at the same time.
http://forum.arduino.cc/index.php?topic=223286.0
Multitasking:
Part 1:
Part 2:
Part 3:
Sparkfun Tutorials:
https://learn.sparkfun.com/tutorials?page=all
Micro Controllers:
Useful links:
https://forum.arduino.cc/index.php?topic=384198.0
Arduino programming traps, tips and style guide:
Arduino programming course:
Jeremy Blume:
Arduino products:
Motors/MOSFETs
Making a library
https://www.arduino.cc/en/Hacking/libraryTutorial
Switches:
Share tips you have come across, 700+ posts:
https://forum.arduino.cc/index.php?topic=445951.0
Debug discussion:
https://forum.arduino.cc/index.php?topic=215334.msg1575801#msg1575801
Frequently Asked Questions:
https://www.arduino.cc/en/main/FAQ#toc10
SMD soldering:
SMD soldering
Number 'type's.
boolean (8 bit) - simple logical true/false, Arduino does not use single bits for bool
byte (8 bit) - unsigned number from 0 to 255
char (8 bit) - signed number from -128 to 127. The compiler will attempt to interpret this data type as a character in some circumstances, which may yield unexpected results
unsigned char (8 bit) - same as 'byte'; if this is what you're after, you should use 'byte' instead, for reasons of clarity
word (16 bit) - unsigned number from 0 to 65535
unsigned int (16 bit)- the same as 'word'. Use 'word' instead for clarity and brevity
int (16 bit) - signed number from -32768 to 32767. This is most commonly what you see used for general purpose variables in Arduino example code provided with the IDE
unsigned long (32 bit) - unsigned number from 0 to 4,294,967,295. The most common usage of this is to store the result of the millis() function, which returns the number of milliseconds the current code has been running
long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647
float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38. Floating point on the Arduino is not native; the compiler has to jump through hoops to make it work. If you can avoid it, you should. We'll touch on this later. Sparkfun.
You select the 'type' best suited for your variables.
ex:
your variable does not change and it defines a pin on the Arduino. const byte limitSwitchPin = 34;
since an analog variable can be 0 to 1023, a byte will not do, you can select 'int'. int temperature;
if your variable needs to be within -64 to +64 a 'char' will do nicely. char joystick;
if your variable is used for ASCII then you need type 'char', char myText[ ] = {"Raspberry Pie Smells"};
if your variable enables some code then boolean can be used. boolean enableFlag = false;
millis() returns the time in ms since rebooting, unsigned long currentTime = millis();
etc.
Oh, and have fun too !
Hello
For online support I´m using:
https://www.learncpp.com/
Have nice day and enjoy coding in C++.
i'd suggest reading the threads on this forum. you'll learn what the common mistakes are and conventional approaches
also set File->Preferences->Compiler warnings at least to "More" so that the compiler helps identify common mistakes
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.