This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

8051 BLUETOOTH

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

Parents
  • 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?

Reply
  • 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?

Children