'Программа для подбора кода цветов дисплея LS020...Siemens S65
' Сергей Черников (c) 2007 -
'Испольуется собственная библиотека управляемая стандартными Bascom-командами


$hwstack = 128
$swstack = 128
$framesize = 128

$regfile = "m128def.Dat"
$crystal = 16000000
$baud = 19200

'$lib "LCD-EPSONmy.LIB"
'$lib "lcd-pcf8833my.lib"                                    'Nokia 6100 color display support только почему-то зеркально отображает
'$lib "Lcd-siemens_s65_ls020_256.lib"                        'Siemens S65 LS020 color display support
$lib "LCD-SIEMENS_S65_LS020_256_W1.LIB"                     'Siemens S65 LS020 color display support Wide
'$lib "LCD-EPSON_L2F50.LIB"                                  'Siemens S65 L2F50 color display support

'Config Graphlcd = Color , Controlport = Portc , Cs = 0 , Rs = 7 , Scl = 1 , Sda = 2 , Reset = 6

Config Graphlcd = Color , Controlport = Porte , Cs = 5 , Rs = 3 , Scl = 6 , Sda = 7 , Reset = 4

Dim N As Byte
Dim Color As Byte
Dim Colorbac As Byte
'256 8-битные цвета vvv
Const Blue = &B00000011                                     ''predefined contants are making programming easier
Const Yellow = &B11111100
Const Red = &B11100000
Const Green = &B00011100
Const Black = &B00000000
Const White = &B11111111
Const Brightgreen = &B00111110
Const Darkgreen = &B00010100
Const Darkred = &B10100000
Const Darkblue = &B00000010
Const Brightblue = &B00011111
Const Orange = &B11111000
Const Violett = 199
Const Brown = 192                                           '128
'256 8-битные цвета ^^^
'(
'Зададим используемые цвета
Const Blue = 51                                             '&B00000011
Const Yellow = 215                                          '&B11001111 '11111100
Const Red = 210                                             '&B11100000
Const Green = 69                                            '&B00011100
Const Black = 0                                             '&B00000000
Const White = 255                                           '&B1111111111111111
Const Brightgreen = 15                                      '&B00111110
Const Darkgreen = 12                                        '&B00010100
Const Darkred = 200                                         '&B10100000
Const Darkblue = 48                                         '&B00000010
Const Brightblue = 55                                       '&B00011111
Const Orange = 212                                          '&B11111000
Const Violett = 176
Const Brown = 128
')
Const белый = &HFF
Const чёрный = &H00
'(
Dim N1 As Byte
For N = 0 To 120
Circle(88 , 65) , N , Brightblue
If N > 20 Then
N1 = N - 20
Circle(88 , 65) , N1 , Green
End If
Next N
'Waitms 1000
Wait 2
')
'$sim
Cls

Setfont Color16x16
Lcdat 7 , 0 , "0123456789=" , Blue , Yellow
Lcdat 23 , 0 , "Sergey Chernikov" , Red , Yellow
Lcdat 39 , 0 , "Сергей Черников" , Red , Yellow
Wait 1
'Lcdat 0 , 0 , "Глуб:P" ; N3 ; " СкорСкан:" ; Sp ; " !" ; Gnd(1) , Black , White
Lcdat 8 , 0 , "ЙЦУКЕНГШЩЗХ" , Black , White
Lcdat 24 , 0 , "ЪФЫВАПРОЛДЖ" , Black , White
Lcdat 40 , 0 , "ЭЯЧСМИТЬБЮй" , Black , White
Lcdat 56 , 0 , "цукенгшщзхъ" , Black , White
Lcdat 72 , 0 , "фывапролджэ" , Black , White                'QWERTYUIOP[]ASDF
Lcdat 88 , 0 , "ячсмитьбю." , Black , White                 'GHJKL;'ZXCVBNM,./
Lcdat 104 , 0 , "qwertyuiop[]asdf" , White , Black
Lcdat 120 , 0 , "ghjkl;'zxcvbnm,./" , White , Black
'Lcdat 88 , 0 , "абвгдеёжзийклмно" , White , Black
'Lcdat 104 , 0 , "прстуфхцчшщъыьэю" , White , Black
'Lcdat 120 , 0 , "я z Ё" , White , Black


Wait 1
Cls
Setfont Color8x8
Lcdat 1 , 0 , "ЙЦУКЕНГШЩЗХ" , Black , White
Lcdat 8 , 0 , "ЪФЫВАПРОЛДЖ" , Black , White
Lcdat 16 , 0 , "ЭЯЧСМИТЬБЮй" , Black , White
Lcdat 24 , 0 , "цукенгшщзхъ" , Black , White
Lcdat 32 , 0 , "фывапролджэ" , Black , White                'QWERTYUIOP[]ASDF
Lcdat 40 , 0 , "ячсмитьбю." , Black , White                 'GHJKL;'ZXCVBNM,./
Lcdat 48 , 0 , "qwertyuiop[]asdf" , White , Black
Lcdat 56 , 0 , "ghjkl;'zxcvbnm,./" , White , Black
Wait 2

Lcdat 8 , 0 , "ЙЦУКЕНГШЩЗХЪФЫВА" , Black , White
Lcdat 16 , 0 , "ПРОЛДЖЭЯЧСМИТЬБЮ" , Black , White
Lcdat 24 , 0 , "йцукенгшщзхъфыва" , Black , White
Lcdat 32 , 0 , "пролджэячсмитьбю." , Black , White
Lcdat 48 , 0 , "QWERTYUIOP[]ASDF" , Black , White
Lcdat 56 , 0 , "GHJKL;'ZXCVBNM,./" , Black , White
Lcdat 64 , 0 , "qwertyuiop[]asdf" , White , Black
Lcdat 72 , 0 , "ghjkl;'zxcvbnm,./" , White , Black
Lcdat 80 , 0 , "абвгдеёжзийклмно" , White , Black
Lcdat 88 , 0 , "прстуфхцчшщъыьэю" , White , Black
Lcdat 96 , 0 , "я z Ё" , White , Black
'Lcdat 72 , 0 , "ghjkl;'zxcvbnm,./" , Black ,  White
Wait 5

Circle(30 , 30) , 26 , Brightblue
Circle(30 , 60) , 26 , Red
Circle(30 , 90) , 26 , Yellow
Circle(30 , 120) , 26 , Brightgreen
Circle(30 , 150) , 26 , Brightblue
'Waitms 1000
Wait 2
Showpic 0 , 0 , Plaatje1                                    'картинка
Wait 2


Color = белый
Colorbac = &HEF
Do

Pset 32 , 110 , Red
Cls                                                         'clear the display
Wait 1

For Color = 0 To 127
Line(color , 0) -(color , 65) , Color
Next Color

For Color = 128 To 255
Colorbac = Color - 128
Line(colorbac , 66) -(colorbac , 131) , Color
Next Color

Wait 1
Box(0 , 0) -(176 , 131) , белый

Setfont Color8x8

For N = 0 To 22
Color = N
Colorbac = N * 8
Lcdat Colorbac , 0 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 22
Colorbac = N * 8
Lcdat Colorbac , 16 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 44
Colorbac = N * 8
Lcdat Colorbac , 32 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 66
Colorbac = N * 8
Lcdat Colorbac , 48 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 88
Colorbac = N * 8
Lcdat Colorbac , 64 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 110
Colorbac = N * 8
Lcdat Colorbac , 88 , Color , Color , белый
Next N
For N = 0 To 22
Color = N + 132
Colorbac = N * 8
Lcdat Colorbac , 112 , Color , Color , белый
Next N



Wait 1

For N = 0 To 22
Color = 22 * 8
Color = N + Color
Colorbac = N * 8
Lcdat Colorbac , 0 , Color , Color , белый
Next N
For N = 0 To 22
Color = 22 * 9
Color = N + Color
Colorbac = N * 8
Lcdat Colorbac , 24 , Color , Color , белый
Next N
For N = 0 To 22
Color = 22 * 10
Color = N + Color
Colorbac = N * 8
Lcdat Colorbac , 48 , Color , Color , белый
Next N
For N = 0 To 22
Color = 22 * 11
Color = N + Color
Colorbac = N * 8
Lcdat Colorbac , 72 , Color , Color , белый
Next N
Wait 1

Box(0 , 0) -(131 , 176) , White
Wait 1
Line(10 , 10) -(130 , 170) , Color
Lcdat 123 , 0 , "Line(10,10)-(130,170),Color" , Red , Yellow
Wait 2
Line(110 , 1) -(1 , 110) , Color
Lcdat 123 , 0 , "Line(110,1)-(1,110),Color" , Red , Yellow
Wait 2
Pset 8 , 8 , Color
Lcdat 123 , 0 , "Pset 8,8, Color" , Red , Yellow
Wait 2
Waitms 1000
Line(65 , 0) -(65 , 130) , Black
Lcdat 123 , 0 , "Line(65,0)-(65,130),Black" , Red , Yellow
Wait 2
Line(10 , 40) -(30 , 40) , Red                              'White
Lcdat 123 , 0 , "Line(10,40)-(30,40),Red" , Red , Yellow
'Wait 1
Wait 2
Showpic 0 , 0 , Plaatje                                     'картинка
Wait 2
'
Setfont Color8x8
Lcdat 123 , 0 , "Sergey Chernikov" , Red , Yellow
Lcdat 115 , 0 , "Сергей Черников" , Red , Yellow
Wait 1

Waitms 1000

'select a font
Setfont Color16x16
'and show some text
Lcdat 7 , 0 , "12345678 =9" , Blue , Yellow
Wait 2
'
Waitms 1000
Circle(30 , 30) , 20 , Blue
'Waitms 100
Circle(30 , 30) , 21 , Yellow
'Waitms 100
Circle(30 , 30) , 22 , Blue
'Waitms 100
Circle(30 , 30) , 23 , Yellow
'Waitms 100
Circle(30 , 30) , 24 , Blue
'Waitms 100
Circle(30 , 30) , 25 , Yellow
'Waitms 100
Circle(30 , 30) , 26 , Blue
Waitms 1000
'
'make a box
Box(0 , 0) -(131 , 131) , белый
Waitms 500
Box(0 , 0) -(131 , 131) , Yellow
Waitms 500
Box(0 , 0) -(131 , 131) , Red
Waitms 500
Box(0 , 0) -(131 , 131) , 43981
Waitms 500

Box(0 , 0) -(10 , 175) , Blue
'Wait 1
Box(11 , 0) -(20 , 175) , Yellow
'Wait 1
Box(21 , 0) -(30 , 175) , Red
'Wait 1
Box(31 , 0) -(40 , 175) , Green
'Wait 1
Box(41 , 0) -(50 , 175) , Black
'Wait 1
Box(51 , 0) -(60 , 175) , White
'Wait 1
Box(61 , 0) -(70 , 175) , Brightgreen
'Wait 1
Box(71 , 0) -(80 , 175) , Darkgreen
'Wait 1
Box(81 , 0) -(90 , 175) , Darkred
'Wait 1
Box(91 , 0) -(100 , 175) , Darkblue
'Wait 1
Box(101 , 0) -(110 , 175) , Brightblue
'Wait 1
Box(111 , 0) -(120 , 175) , Orange
'Wait 1
Box(121 , 0) -(130 , 175) , Violett
'Wait 1
'Box(131 , 0) -(140 , 175) , Brown
Wait 10


Box(10 , 10) -(130 , 130) , Green
Wait 2
Cls
Box(15 , 20) -(170 , 130) , Red
Wait 2
Cls
Wait 1
'set some pixels
Pset 32 , 110 , White
Pset 38 , 110 , White
Pset 35 , 112 , Blue
Wait 2
Pset 35 , 112 , Blue
Cls
Wait 1
Loop
'End



Plaatje:
$bgf "mcsez.bgc"

Plaatje1:
$bgf "1_1.bgc"

$include "color8x8wRus.font"
$include "color16x16wRus.font"