Debugging

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

1.

Make sure that you have grouped your functions with the appropiate brackets { or
(
2. Your for loop contains of three main parts, namely the initialization of the
variable, the test confition of the
variable, and the incrementation or decrementation of the variable. e.g. for(int
i; i < 4; i++);
3. Remember that you have placed breaks in your code if needed
4. ill say this again, make sure that your functions are properly enclosed with the
appropiate brackets such as { or ( these
could be functions like the loop, setup or your own defined functions
5. Make sure that with your values theres space for a terminating null
6. When working with potentiometers, make sure you connect either side with +V and
the center pin with the arduino input pin,
leaving the last side pin for the ground, -V
7. Make sure that the variables you want to use are of the right structure. Pay
attention to parameters such as the variable
type (e.g. char or int) (signed or unsigned) and most importantly whether it is
a global or local varaiable. local variables
are variables defined under a void function and global are ones that are defined
outside of these functions. Remember that local
variables are only to be used within the void functions they were called in.
Global variables can be used by multiple void functions.
8. Ensure that your case sensitive functions are properly assigned as like if(nine
== 9) works and if(nine = 9) will gile you problems
9. Remember that for your board to perform digital read or analog read the button,
switch etc must be properly sourced with voltage
correctly grounded
10.Keep in mind that when using swicth case statements make sure that when you are
switching with numerical values, the numerical values
to be switched with must be stated in ascending order and not mixed nor
descending or else the numbers wont be executed with

You might also like