Go Down

Topic: Problem on Project 8 - Tilt Sensor Does Not Turn Off all LED Lights Instantly (Read 667 times) previous topic - next topic

jaderblade

Hi,

This is my first post.
I've been working through the starter kit, and and made the circuit and coded just like the book says.
The problem is that when I tilted the breadboard, some of the LED lights are turned off, but some of them are still turned on.

I am using the Arudino Uno microcontroller.

I was wondering if someone encountered this problem before, and found a solution for it.

Thank you.

jurs

Hi,

This is my first post.
Welcome to this forum!


I've been working through the starter kit, and and made the circuit and coded just like the book says.
The problem is that when I tilted the breadboard, some of the LED lights are turned off, but some of them are still turned on.


I am using the Arudino Uno microcontroller.

I was wondering if someone encountered this problem before, and found a solution for it.
I don't have the official Arduino  starter kit, but I have the code, it is in the Arduino IDE. I have IDE version 1.6.5-r5, the starter projekt code is included as example in menu option:
"File-Examples-10. Starter Kit- >p08_DigitalHourglass"

I think your observations are caused by a wrong program code!

I neither have the "starter kit" nor I have the "project book" or any instructions.
The only thing I have is the code from the examples in the Arduino IDE.

The code looks wrong to me.

One major problem of the code seems to be:
- the status of the tilt switch is only checked once every ten minutes!

After 10 minutes have passed, put another LED to ON", then check the tilt switch whether it has changed.

So it is fully normal using the original code: After a change of the tilt switch has happened, nothing else will happen with the LEDs for up to 10 minutes.
That's what the code in the program tells me.

If you want a tilt switch which is "responsive all the time", you need a different program code.

I don't know if somebody has fixed the code meanwhile to provide a better user experience with that starter kit project. It's simple hardware (one switch, several LEDs) and simple software, so I don't know why somebody released such a bad example code for that.

If you'd like to see a different program than you have, either you or somebody else will have to create a newer and better example program.

I could do, but not this week.

If you are a patient person, please let me know, and if I find some time, perhaps next week, I can provide a different code for the hourglass starter project, maybe.
But keep in mind: I don't have the hardware and I don't have the project book, so I cannot do a full test with hardware and software, but I would do my best to provide a better code for thehourglass and tilt-switch hardware, if you like.
Happy holidays!

Go Up