hye everyone, here i hve one question based on assembly language which im gonna use in 8051 microcontroller, my question is how can i modify my code to make the program to function when i send a character to it via bluetooth from android mobile,the led turn ON and when i release the button in my android mobile which means stop sending character,the led turn off? Here is my code,
org 0000h mov p0,#09h mov p3,#00h mov p2,#00h mov TMOD,#20h mov th1,#-3 mov scon,#50h setb tr1 here: jnb ri,here mov a,sbuf clr ri cjne a,#'U',one mov p2,#00000001b sjmp here one: cjne a,#'D',two mov p2,#00000010b sjmp here end
Do you think it makes any difference whatsoever to the 8051 whether the character originated on Android or came via bluetooth...?
No,now my problem is when i use this code and press the button on android which sends 'U' character to the 8051,the LED which connected to serial port keep lighting even when i release the button on the android which stop sending character...so how can i make the LED to light when i press the button on android and stop lighting when i stop pressing the button on android which stop sending character??
Oh dear.
YES??any problem on that??
Why would you connect an LED to a serial port??
I think he means figuratively not literally, but I think you know that too.
So does the Android tell you that the key is no longer pressed, or just stop sending.
With the latter you'll need to determine what the expected repeat rate is, and set some sort of timeout value to count off since you last got a character, and when that expires with no character being sent, then you turn off the LED.
Perhaps time to work through your coursework, notes, and textbooks, to see what applicable methods/tools you have at your disposal?
... but I think you know that too."
The failure to take the opportunity to explain clearly does not inspire confidence.
or have each character trigger the LED to light for a time somewhat longer than the repeat interval - then the LED will stay on as long as characters keep coming...