RGB Matrix module 20x40 1/5 scan GKGD - error of display of the image

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    Aufgrund technischer Veränderungen ist der Mailverkehr innerhalb des Forums (Private Nachrichten) nur noch eingeschränkt möglich. Die Einschränkung ist notwendig, um zusätzliche Betriebskosten für das Forum zu vermeiden. Näheres zu den Hintergründen im Thread "Aktuelles zum Forum".Wir bitten um Verständnis.

    Hinweis kann nach Kenntnisnahme deaktiviert werden!

    • You remember ? - Mike says We mußt send 10 bytes. And we do it only Once / Twice? a_45_132ca9f5

      Please
      Call Set_text_6_8(0 , 0 , red)
      Call Set_text_6_8(5 , 0 , Green)
      Call Set_text_6_8(0 , 5 , blue)
      Memory_ green(99)=206
      into the code which resulds image 33
      These code must not have the memory mapping (#113 /#119)
      And please number the codes - Maybe with image or treath number like:

      ' Version 33 ( or Version #128)
      '20x40 Ledmatrixes RGB, 1_5 scan
      ...
    • code#34

      Pluto25 schrieb:

      please show compled code
      if some dot became two colors they should show mixed color not only one?

      Lost dots are not a problem in the Panel. They are killed in Set_text_6_8
      Is it what you want or an error?
      Should i change it?
      Yes, of course. We have 7 flowers.

      Quellcode

      1. '20x40 Ledmatrixes RGB, 1_5 scan
      2. $regfile = "m328def.dat"
      3. $crystal = 16000000
      4. $hwstack = 40
      5. $swstack = 16
      6. $framesize = 32
      7. Const Dy_num_h = 1 'displays in a horizontal direction
      8. Const Dy_num_v = 1 'displays in the vertical direction
      9. Const Bytes_in_row = 5 * Dy_num_v
      10. Const Row_num = 20 * Dy_num_h
      11. Const Row_num1 = Row_num - 1
      12. Const Mem_size = Row_num * Bytes_in_row
      13. Const Mem_size_1 = Mem_size - 1
      14. Const Dy_offset = Dy_num_v * 100
      15. Const Channel_offset = 10 * Bytes_in_row
      16. P_r1 Alias Portd.5 : Config P_r1 = Output : Dout_port_r1 Alias Portd : Const Dout_pin_r1 = Pd5
      17. P_g1 Alias Portd.7 : Config P_g1 = Output : Dout_port_g1 Alias Portd : Const Dout_pin_g1 = Pd7
      18. P_b1 Alias Portd.6 : Config P_b1 = Output : Dout_port_b1 Alias Portd : Const Dout_pin_b1 = Pd6
      19. P_r2 Alias Portc.4 : Config P_r2 = Output : Dout_port_r2 Alias Portc : Const Dout_pin_r2 = Pc4
      20. P_g2 Alias Portc.3 : Config P_g2 = Output : Dout_port_g2 Alias Portc : Const Dout_pin_g2 = Pc3
      21. P_b2 Alias Portc.2 : Config P_b2 = Output : Dout_port_b2 Alias Portc : Const Dout_pin_b2 = Pc2
      22. P_a Alias Portc.0 : Config P_a = Output
      23. P_b Alias Portc.1 : Config P_b = Output
      24. P_c Alias Portb.0 : Config P_c = Output
      25. P_ckl Alias Portb.5 : Config P_ckl = Output
      26. P_lat Alias Portb.3 : Config P_lat = Output
      27. P_oe Alias Portb.2 : Config P_oe = Output
      28. Shift_clock_port Alias Portb : Const Shift_clock_pin = Pb5
      29. Config Base = 0
      30. Const Timer2reload = 71000
      31. Config Timer2 = Timer , Prescale = 256
      32. Load Timer2 , Timer2reload
      33. On Ovf2 Display_refresh
      34. Enable Ovf2
      35. Start Timer2
      36. 'PWM ************************************************** *************************
      37. Config Timer1 = Pwm , Pwm = 8 , Compare B Pwm = Clear Down , Prescale = 1
      38. '************************************************* ******************************
      39. Dim Memory_red(mem_size) As Byte , Memory_green(mem_size) As Byte , Memory_blue(mem_size) As Byte 'memory red/green
      40. Dim Page_counter As Byte
      41. Dim D_1 As Word
      42. Dim Index_1 As Word , Index_2 As Word
      43. Dim Character_column As Byte
      44. Dim Font_byte_low As Byte
      45. Dim N_1 As Word
      46. Dim M_1 As Word , M_2 As Word , M_22 As Word
      47. Dim Sign As String * 1
      48. Dim Tab_start As Word 'Startwert der Fonttabelle
      49. Dim X1 As Word
      50. Dim Inverting As Bit
      51. Dim Speed As Word
      52. Dim Text As String * 15
      53. Dim Max_baseline As Word
      54. Dim Startbyte_low As Word , Bit_num As Byte
      55. Dim Trigger As Bit
      56. Dim Inv1 As Bit , Inv As Bit
      57. Dim Color As Byte , Red As Byte , Green As Byte , Blue As Byte , Yellow As Byte , Magenta As Byte , Cyan As Byte , White As Byte
      58. Dim Brightness As Byte
      59. Declare Sub Shift6out(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
      60. Declare Sub Set_text_6_8(byval X As Word , Byval Y As Word , Byval Color As Byte)
      61. Red = 1 : Green = 2 : Yellow = 3 : Blue = 4 : Magenta = 5 : Cyan = 6 : White = 7
      62. '**************************************************
      63. 'user settings
      64. Inverting = 0
      65. '**************************************************
      66. Dim H As Byte , B_1 As Byte
      67. Brightness = 50
      68. Gosub Clear_memory
      69. Enable Interrupts
      70. Text = "374 2"
      71. Call Set_text_6_8(0 , 0 , Red)
      72. Call Set_text_6_8(5 , 0 , Green)
      73. Call Set_text_6_8(0 , 5 , Blue)
      74. Memory_green(99) = 206
      75. Do
      76. Loop
      77. End
      78. Display_refresh:
      79. Load Timer2 , Timer2reload
      80. If Page_counter < 4 Then
      81. Incr Page_counter
      82. Else
      83. Page_counter = 0
      84. End If
      85. Index_1 = 4 - Page_counter
      86. For D_1 = 1 To 10
      87. Index_2 = Index_1 + 5
      88. Shift6out Memory_red(index_2) , Memory_green(index_2) , Memory_blue(index_2) , Memory_red(index_1) , Memory_green(index_1) , Memory_blue(index_1)
      89. Index_1 = Index_1 + 10
      90. Next D_1
      91. Pwm1b = 0
      92. Waitus 100
      93. P_lat = 1 : P_lat = 0
      94. P_a = Page_counter.0
      95. P_b = Page_counter.1
      96. P_c = Page_counter.2
      97. Pwm1b = Brightness
      98. Trigger = 1
      99. Return
      100. ' R1 G1 B1 R2 G2 B2
      101. Sub Shift6out(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
      102. $asm
      103. LDI r17,8
      104. Loop_shift2out:
      105. in R16, dout_port_r1
      106. BST r18,0
      107. BLD r16,Dout_pin_r1
      108. Out Dout_port_r1 , R16
      109. in R16, dout_port_g1
      110. BST r19,0
      111. bld r16,Dout_pin_g1
      112. Out Dout_port_g1 , R16
      113. in R16, dout_port_b1
      114. BST r20,0
      115. bld r16,Dout_pin_b1
      116. Out Dout_port_b1 , R16
      117. in R16, dout_port_r2
      118. BST r21,0
      119. BLD r16,Dout_pin_r2
      120. Out Dout_port_r2 , R16
      121. in R16, dout_port_g2
      122. BST r22,0
      123. bld r16,Dout_pin_g2
      124. Out Dout_port_g2 , R16
      125. in R16, dout_port_b2
      126. BST r23,0
      127. bld r16,Dout_pin_b2
      128. Out Dout_port_b2 , R16
      129. SBI shift_clock_Port, shift_clock_Pin
      130. LSR r18
      131. LSR r19
      132. lsr r20
      133. lsr r21
      134. lsr r22
      135. lsr r23
      136. dec r17
      137. CBI shift_clock_Port, shift_clock_Pin
      138. BRnE loop_shift2out
      139. $end Asm
      140. End Sub
      141. Clear_memory:
      142. For N_1 = 0 To Mem_size_1
      143. Memory_red(n_1) = 0
      144. Memory_green(n_1) = 0
      145. Memory_blue(n_1) = 0
      146. Next N_1
      147. Return
      148. Sub Set_text_6_8(byval X As Word , Byval Y As Word , Byval Color As Byte)
      149. Local Col As Word
      150. '6x8font
      151. Max_baseline = Row_num - 12
      152. If Y > Max_baseline Then Y = Max_baseline
      153. Inv1 = Inverting Xor Inv
      154. For M_1 = 1 To Len(text)
      155. Sign = Mid(text , M_1 , 1) 'Only one letter
      156. Tab_start = Asc(sign)
      157. Tab_start = Tab_start - 32
      158. Tab_start = Tab_start * 6 'Starting point in the font table
      159. For Character_column = 0 To 5
      160. Bit_num = X Mod 8 'bit-number of byte
      161. Col = X / 8 'number of column
      162. Startbyte_low = Col * Row_num
      163. Startbyte_low = Startbyte_low + Y
      164. If Startbyte_low > Mem_size_1 Then Exit Sub 'there is no space, you are ready
      165. X1 = Tab_start + Character_column
      166. Font_byte_low = Lookup(x1 , Font_6x8)
      167. For M_2 = 0 To 7
      168. M_22 = Startbyte_low + M_2
      169. If Color.0 = 1 Then 'red
      170. If Inv1 = 1 Then
      171. Memory_red(m_22).bit_num = Not Font_byte_low.m_2
      172. Else
      173. Memory_red(m_22).bit_num = Font_byte_low.m_2
      174. End If
      175. Else
      176. Memory_red(m_22).bit_num = Inverting
      177. End If
      178. If Color.1 = 1 Then 'green
      179. If Inv1 = 1 Then
      180. Memory_green(m_22).bit_num = Not Font_byte_low.m_2
      181. Else
      182. Memory_green(m_22).bit_num = Font_byte_low.m_2
      183. End If
      184. Else
      185. Memory_green(m_22).bit_num = Inverting
      186. End If
      187. If Color.2 = 1 Then 'blue
      188. If Inv1 = 1 Then
      189. Memory_blue(m_22).bit_num = Not Font_byte_low.m_2
      190. Else
      191. Memory_blue(m_22).bit_num = Font_byte_low.m_2
      192. End If
      193. Else
      194. Memory_blue(m_22).bit_num = Inverting
      195. End If
      196. Next M_2
      197. Incr X
      198. Next Character_column
      199. Next M_1
      200. End Sub
      201. Font_6x8:
      202. Data 0 , 0 , 0 , 0 , 0 , 0 ' <SPACE>
      203. Data 0 , 0 , 96 , 250 , 96 , 0 ' !
      204. Data 0 , 224 , 192 , 0 , 224 , 192 ' "
      205. Data 0 , 48 , 64 , 254 , 64 , 48 ' #
      206. Data 0 , 24 , 4 , 254 , 4 , 24 ' $
      207. Data 0 , 16 , 56 , 84 , 84 , 16 ' %
      208. Data 0 , 16 , 84 , 84 , 56 , 16 ' &
      209. Data 0 , 0 , 224 , 192 , 0 , 0 ' <ZAP>
      210. Data 48 , 96 , 255 , 255 , 96 , 48 ' (
      211. Data 12 , 6 , 255 , 255 , 6 , 12 ' )
      212. Data 24 , 60 , 126 , 90 , 24 , 24 ' *
      213. Data 16 , 16 , 124 , 16 , 16 , 0 ' +
      214. Data 0 , 0 , 7 , 6 , 0 , 0 ' ,
      215. Data 0 , 16 , 16 , 16 , 16 , 16 ' -
      216. Data 0 , 0 , 6 , 6 , 0 , 0 ' .
      217. Data 2 , 4 , 8 , 16 , 32 , 64 ' /
      218. Data 0 , 124 , 138 , 146 , 162 , 124 ' 0
      219. Data 0 , 0 , 66 , 254 , 2 , 0 ' 1
      220. Data 0 , 70 , 138 , 146 , 146 , 98 ' 2
      221. Data 0 , 68 , 146 , 146 , 146 , 108 ' 3
      222. Data 0 , 24 , 40 , 72 , 254 , 8 ' 4
      223. Data 0 , 228 , 162 , 162 , 162 , 156 ' 5
      224. Data 0 , 60 , 82 , 146 , 146 , 12 ' 6
      225. Data 0 , 192 , 142 , 144 , 160 , 192 ' 7
      226. Data 0 , 108 , 146 , 146 , 146 , 108 ' 8
      227. Data 0 , 96 , 146 , 146 , 148 , 120 ' 9
      Alles anzeigen
    • Please change Shift6out with:

      Quellcode

      1. Sub Shift6out(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
      2. $asm
      3. LDI r17,8
      4. Loop_shift2out:
      5. in R16, dout_port_r1
      6. BST r18,7
      7. BLD r16,Dout_pin_r1
      8. Out Dout_port_r1 , R16
      9. in R16, dout_port_g1
      10. BST r19,7
      11. bld r16,Dout_pin_g1
      12. Out Dout_port_g1 , R16
      13. in R16, dout_port_b1
      14. BST r20,7
      15. bld r16,Dout_pin_b1
      16. Out Dout_port_b1 , R16
      17. in R16, dout_port_r2
      18. BST r21,7
      19. BLD r16,Dout_pin_r2
      20. Out Dout_port_r2 , R16
      21. in R16, dout_port_g2
      22. BST r22,7
      23. bld r16,Dout_pin_g2
      24. Out Dout_port_g2 , R16
      25. in R16, dout_port_b2
      26. BST r23,7
      27. bld r16,Dout_pin_b2
      28. Out Dout_port_b2 , R16
      29. SBI shift_clock_Port, shift_clock_Pin
      30. LSl r18
      31. LSl r19
      32. lsl r20
      33. lsl r21
      34. lsl r22
      35. lsl r23
      36. dec r17
      37. CBI shift_clock_Port, shift_clock_Pin
      38. BRnE loop_shift2out
      39. $end Asm
      40. End Sub
      Alles anzeigen
      And
      Call Set_text_6_8(5 , 0 , Green) with
      Call Set_text_6_8(0 , 8 , Green)

      (rename code 'code#34_004)
    • please insert this

      Quellcode

      1. Enable Interrupts ' From here:
      2. Dim Atemp As Byte, A1 As Byte , A2 As Byte , A3 As Byte , A4 As Byte
      3. Text = "374 2"
      4. Call Set_text_6_8(0 , 0 , Green)
      5. Gosub Remap_memory
      6. Do
      7. Loop
      8. End
      9. Remap_memory:
      10. For A1 = 0 To 80 Step 20
      11. For A2 = 0 To 4
      12. A3 = A1 + A2
      13. A4 = A3 + 15
      14. Atemp = Memory_green(a3)
      15. Memory_green(a3) = Memory_green(a4)
      16. Memory_green(a4) = Atemp
      17. Next
      18. Next
      19. Return
      Alles anzeigen
    • change Remap_memory: with

      Quellcode

      1. Remap_memory:
      2. For A1 = 0 To 80 Step 20
      3. For A2 = 0 To 4
      4. A3 = A1 + A2
      5. A4 = A3 + 15
      6. Atemp = Memory_green(a3)
      7. Memory_green(a3).0 = Memory_green(a4).7
      8. Memory_green(a3).1 = Memory_green(a4).6
      9. Memory_green(a3).2 = Memory_green(a4).5
      10. Memory_green(a3).3 = Memory_green(a4).4
      11. Memory_green(a3).4 = Memory_green(a4).3
      12. Memory_green(a3).5 = Memory_green(a4).2
      13. Memory_green(a3).6 = Memory_green(a4).1
      14. Memory_green(a3).7 = Memory_green(a4).0
      15. Memory_green(a4) = Atemp
      16. Memory_green(a4).0 = Atemp.7
      17. Memory_green(a4).1 = Atemp.7(a3).6
      18. Memory_green(a4).2 = Atemp.5
      19. Memory_green(a4).3 = Atemp.4
      20. Memory_green(a4).4 = Atemp.3
      21. Memory_green(a4).5 = Atemp.2
      22. Memory_green(a4).6 = Atemp.1
      23. Memory_green(a4).7 = Atemp.0
      24. Next
      25. Next
      26. Return
      Alles anzeigen