Comments 7

  • A Simple Arduino Menu With An LCD over 1 year ago

    See Mr_Glenn's comment.

  • A Simple Arduino Menu With An LCD over 1 year ago

    Hi, Well done on your debugging! I think I might have pinned down the problem (from your code changes and explanation) .

    The "if (brightness <= 0 || brightness >= 255) {fadeAmount = -fadeAmount;} " doesn't know which direction the brightness is going. When the brightness value is 255 after the blink or "On" , the fadeAmount is at -5 sometimes.
    The if statement checks the brightness value and sees that it is >= 255. It sets fadeAmount to +5. In next iteration of the function brightness is 260 and sets fadeAmount to -5. Brightness is then set at 255 it then increases brightness again to 260 forever going into a endless spiral of doom and despair . Hence it going from 255 to 260 and back again.

    A little less code would be to set the brightness value to 128. (Line 82) It would not then get caught in the 255-260 loop.

    I'm not sure if the operator "-" is considered a function. I use operators within abs all the time and have not come across any issues with it.

    PS. I literally gave myself a facepalm on not setting the type.

  • A Simple Arduino Menu With An LCD over 1 year ago

    I've updated the code with your error findings. I did not test it but theoretically it should work properly now.
    1. The timer variable should be an "unsigned long" as the timer itself is an unsigned long type. This will sort the glitch with the fade. (It was fading very fast)
    2. Added a const to hold the number of buttons.
    3. Corrected the pin assignments. (and added comments for the extra pin.

    Thank you for your feedback on the projects. You have made it better!

  • A Simple Arduino Menu With An LCD over 1 year ago

    Hi, I seem to have overlooked the functions.ino, oops. I have rectified this and is now part of the code.

  • Arduino Laser Tripwire over 1 year ago

    You should be able to get it working. You might have to tweak the code a bit. Modify the minLight and trip values. Play around with it and let me know if you got it working!

  • Arduino Simple "Camera Slider" Electronics about 2 years ago

    Hi, I'm going to use it for a camera slider that I've built.
    I am quite new to the Arduino and haven't even heard of interrupts. I'll try it out!

  • Arduino Laser Tripwire about 2 years ago

    The one without the laser pointer will give the ambient light readout. The factor of the drop when the laser is broken in a bright light is smaller than when broken in a dark area. The second photo resistor gives a little more control.

Add projectSign up / Login