i am not new to arduino but i do need help now and again. i have made a light timer but would like to not use delay. i have also made an app for my phone and it all works by bluetooth. i just would like to be able to still control my lights while the timer is going. here is my code and help and advice would be great thank you.
Yes I saw the first post and I am only asking for help because I don't quite understand how to implement it. I get a little lost I am not as good as i once was sadly.
Please look at Blink Without Delay. It's not that hard. And a good idea is to first make a simple sketch where you use it and later try to implement it in this sketch.
And if you want more help around here, place your code in code tages ([code ] //code[/code ]). It's completely unreadable now.
septillion:
Please look at Blink Without Delay. It's not that hard. And a good idea is to first make a simple sketch where you use it and later try to implement it in this sketch.
And if you want more help around here, place your code in code tages ([code ] //code[/code ]). It's completely unreadable now.
I repeat...CHANGE THIS! This is poor poor poor programming even after you have been advised to change it.
You dont seem to understand that "if( Serial.available() ) {;}" does LITERALLY NOTHING! All you are doing is checking if there is data available, then doing nothing, you are better off just deleting it. The only reason your program is working is because if you try to read data from serial when there is nothing, it returns a -1. And even then you are trying to store a -1 in an 8 bit unsigned variable which underflows to 255. (Arduino uses a signed byte for char...)
Now read my previous post and change it to that...