Data eseten adattarolas - SendScankbd
    Cseh Róbert 
    R.Cseh at Richter.hu
       
    Thu Dec  2 10:41:15 CET 2004
    
    
  
Sziasztok!
AVR-l kuzdok, es mielott nagyot szivne'k (BasCOM a fejlesztokornyezet, 1.1.11.74 valtozat):
A Data sorban megadott fix adatok hol tarolodnak programfutaskor?
- proci SRAMban?
- Flashba belesutve, es onnan olvasgat a program amikor kell?
- egyeb....
A SendScanKbd fuggvenynek parameterkent kell adni egy data sort hogy miket kuldjon el.
Ez kivalthato valami egyszerubbre? Nekem generalt/kapott adatsort kell visszakuldenem.
Az utolsó sor kellene valahogy úgy, hogy
Data 4, [kiirandóbetűHEXAkódja],&HF0, [kiirandóbetűHEXAkódja]
Tippek?
Robi
Minta:
$regfile = "2313def.dat"
$crystal = 4000000
baud = 19200
$lib "mcsbyteint.lbx"                   ' use optional lib since we use only bytes
'configure PS2 AT pins
Enable Interrupts                       ' you need to turn on interrupts yourself since an INT is used
Config Atemu = Int1 , Data = Pind.3 , Clock = Pinb.0
'                 ^------------------------ used interrupt
'                              ^----------- pin connected to DATA
'                                       ^-- pin connected to clock
'Note that the DATA must be connected to the used interrupt pin
Waitms 500                              ' optional delay
'rcall _AT_KBD_INIT
Print "Press t for test, and set focus to the editor window"
Dim Key2 As Byte , Key As Byte
Do
    Key2 = Waitkey()                    ' get key from terminal
    Select Case Key2
      Case "t" :
      Waitms 1500
      Sendscankbd Mark                  ' send a scan code
      Case Else
    End Select
Loop
Print Hex(key)
Mark:                                   ' send mark
Data 12 , &H3A , &HF0 , &H3A , &H1C , &HF0 , &H1C , &H2D , &HF0 , &H2D , &H42 , &HF0 , &H42
'    ^ send 12 bytes
'           m                    a                   r                    k
    
    
More information about the Elektro
mailing list