coding and switching

hi all

just getting into arduino and coding and my 1st project is a knock sensor that lights up an led for a period of time. my problem is i cant get the knock sensor to set the led off, i ran a test for the knock sensor and there is a change in voltage across the terminals and then i ran a test for the led and that is working fine. my thought is that somewhere in the code its not joining the dots and im at a bit of a loss as to where to go from here.

ive added some files if someone would be so kind as to as to cast their eye across it that would be much appreciated


Firmware (1).zip (18.7 KB)

Please post your code following the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

Hi drchops,

if you are completely new to programming this code is too complicated.
it is like a person trying to ride a one-wheel bike who has not even learned to ride a two-wheel bike.
In this situation trying to ride a one-wheel-bike does not work.
For the one-wheel-riding you would have tp practice a lot to gain enough balancing-skills to stay on the one-wheel for more than 3 seconds.. At least you would have to practice for 50 hours.

The good thing about programming is:
to learn the pure basics will only take 10 hours. But it is not done in half an hour.

So I recommend Take a look into this tutorial:

Arduino Programming Course

It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.

You can ask as many questions as you like. But there is one condition to get real helping answers:

The questions must be concrete.

best regards Stefan