Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $regfile = "m8Adef.dat"
  2. $crystal = 8000000
  3. 'the internal oscillator of 8 Mhz was choosen in the fusebits
  4.  
  5.  
  6. Dim Volume As Byte
  7. Dim Muteflag As Bit
  8.  
  9.  
  10. Config Portd = Output
  11. Config Portc = Output
  12. Config Portb = Input
  13. Config Scl = Portc.0                                        'Is serial clock SCL
  14. Config Sda = Portc.1                                        'Is serial data SDA
  15. I2cinit
  16.  
  17. Const Lm48100l = &B11111000                                 'Adress left amplifier
  18. Const Lm48100r = &B11111010                                 'Adress right amplifier
  19.  
  20.  
  21. Main:
  22.  
  23. Volume = 2
  24. Muteflag = 0
  25.  
  26. I2cstart
  27. I2cwbyte Lm48100l
  28. I2cwbyte &B00010100
  29. I2cwbyte &B01111111
  30. I2cstop
  31. Waitms 25
  32.  
  33. I2cstart
  34. I2cwbyte Lm48100r
  35. I2cwbyte &B00010100
  36. I2cwbyte &B01111111
  37. I2cstop
  38. Waitms 25
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement