Hello ! I am starting learning Programming Arduino with the book "programmer arduino en s'amusant" and it is the first time i write on this forum. The project is a binary counter with 2 leds. The leds are showing the counting from 0 to 3. I try to understand what is happening behind the code but I don't figure it out. Please can someone explain me step by step what is happening ?
When it counts 0, led 2 and led 1 are respectivelly at 0 and 0 states
When it counts 1, led 2 and led 1 are respectivelly at 0 and 1
When it counts 2, led 2 and led 1 are respectivelly at 1 and 0
When it counts 3, led 2 and led 1 are respectivelly at 1 and 1
etc...
bEtatU is the state for led1
bEtatD is the state for led2
bPrecU is the state before
I try to understand what is happening behind the code but I don't figure it out. Please can someone explain me step by step what is happening ?
explain what you tried to achieve and what you see. I don't see any count going from 0 to 3...
please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. (also make sure you indented the code in the IDE before copying, that's done by pressing ctrlT on a PC or cmdT on a Mac)
If you are trying to figure out what each line of code means, then I suggest that it is best to buy an introductory book on Arduino programming to learn.