Announcement

Collapse
No announcement yet.

Bascom-avr how can I get a variable, and print it on Oled

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bascom-avr how can I get a variable, and print it on Oled

    I will like to have an variable on my uOled 160 G1
    but how!

    Call Draw_string_text_format(10 , 1 , 5x7 , Red , VAR)
    x y font color variable
    the "VAR" is the input of my RC5 remote

    Do'Getrc5(address , Command) If Address 255 Then '255 Command = Command And &B0111_1111 '&B01111111 Rc5key = Command If Command 255 Then Select Case Command Case Else : Command = 254 '254 End SelectVAR = Rc5key
    Call Draw_string_text_format(10 , 0 , 5x7 , White , "RC5 Code") "this is working" Call Draw_string_text_format(10 , 1 , 5x7 , Red , VAR) End IfLoop

  • #2


    I'm not familiar with Bascom, but a quick look at the reference manual revealed it supports strings, so you should be able (not sure how) to convert "VAR" to a string and pass that to Draw_string_text_format

    Another possibility is to use the #channel parameter to write "VAR" directly to the serial port, but to do this will require you to change the code around to support the use of that.
    Mark

    Comment


    • #3


      Ok I found the solution of my problem
      look...
      Do'Getrc5(address , Command) If Address 255 Then '255 Command = Command And &B0111_1111 '&B01111111 Rc5key = Command If Command 255 Then Select Case Command Case Else : Command = 254 '254 End SelectRc5key = Str (VAR) It's so simple if you know how
      Call Draw_string_text_format(10 , 0 , 5x7 , White , "RC5 Code") "this is working" Call Draw_string_text_format(10 , 1 , 5x7 , Red , VAR) End IfLoop

      Comment

      Working...
      X