Hello, Im trying to use software serial to connect my arduino uno r3 to my android phone through HC-05 and that is working perfectly, then im using both interrupt 0 on arduino uno and Timer 1 library to control an AC load like a bulb and that works perfectly BUT WITHOUT THE SOFTWARE SERIAL LIBRARY.
The problem is that Software serial library keeps turning the interrupts off and on repeatedly which appeared as the flicking of the bulb on the specified dimming levels except the highest dimming level which the full power is used= 120VAC of course.
The question is: Is there any software library that doesn't rely on interrupts ? and after googling alot I found SimpleTimer library that may do the job right, it that true ? any suggestion?
Note: I chose my software serial pins accurately which doesn't conflict with my timer1 library .... I chose pins Rx=7,Tx=12.
and output for ac triac driver is 4 so its not connected to timer 0.
also I chose interrupt 0 on the uno which is on pin 2.
The dimming circuit and code and running perfectly.
and the HC-05 + app inventor app is working perfectly
but when I combine them ... the software serial library misses up the interrupts or something and the result is a flicking bulb
I was trying to use the pins 0&1 on the uno for serial communication after I upload the code... but It didnt work so I used instead software serial...It used to run using pins 0 and 1 but now its not .... any ideas ?
more about this another question here : small problem with arduino uno+ bluetooth module HC-05 - Programming Questions - Arduino Forum
any possible solution or ideas would be very appreciated.
I dont wanna use mega ... but will test with it ....
I build my own standalone boards so I want to use a standalone atmega328 chip.
I still have one possible hardware solution but i dont wanna go there.
I was trying to use the pins 0&1 on the uno for serial communication after I upload the code... but It didnt work
Trying to use pins 0 and 1 how? Serial.print() always works.
I dont wanna use mega
You prefer to have code that doesn't (and can't be made to) work. That's fine by me.
I build my own standalone boards so I want to use a standalone atmega328 chip.
Build a standalone board using an AtMega2560. Or, there are other chips with multiple hardware serial ports (the 644 comes to mind) in through-hole configuration.
ok thanks for the suggestion paul
but the atmega2560 is alittle expensive... the 644 is a good choice but I don't have it for now, maybe later I will try one.
I was thinking of using an attiny85 that will handle the bluetooth communication and send the data through the output pins, But since the attiny doesnt have a builtin UART so no serial pins... I was thinking of using a vertual UART or software serial... that may fix the problem