| |
|
|
 | G510s Keyboard LCD Display Snake Verwenden Ansteuern
Habe mir gestern per 55 Euro bei Saturn eine Tastatur gekauft: G510s

Tolles Teil, Tasten super - darum gekauft. Schreibgefühl herrlich und nur danach ausgesucht.
Wie auch immer, das Teil hat ein LCD-Display.
Wie auch immer, das wollen wir naturalmente verwenden mit XProfan.

So mit Pixel und Setzen und Löschen - also ein Snake:

Hier der Code um eigene APPS per das Display herstellen zu können mit NativeProfanFree: [...] 
{$cleq}
//g510s lcd (160x43x1) display usage with xprofan
DEF LogiLcdInit(2) ! "LogitechLcd.dll","LogiLcdInit"
DEF LogiLcdIsConnected(1) ! "LogitechLcd.dll","LogiLcdIsConnected"
DEF LogiLcdMonoSetBackground(2) ! "LogitechLcd.dll","LogiLcdMonoSetBackground"
DEF LogiLcdUpdate(0) ! "LogitechLcd.dll","LogiLcdUpdate"
declare g510&
cls
g510.createDisplay()
long x=80,y=20
do {
g510.setPixel(x,y,getTickCount\300 mod 2)
g510.refresh(1)
waitinput 300
g510.setPixel(x,y,true)
select %scankey
caseof 37 : dec x
caseof 38 : dec y
caseof 39 : inc x
caseof 40 : inc y
endselect
}
end
//
g510.createDisplay(){
usedll("LogitechLcd.dll")
LogiLcdInit("X\zP\zr\zo\zf\za\zn\z.\zN\ze\zt\z\z" ,1)
g510&=globalAlloc(gPTR,8192)
rtlZeroMemory(g510&,8192)
}
nproc g510.cls{
global g510&
rtlZeroMemory(g510&,8192)
}
nproc g510.setPixel(long x,y,pixel){
global g510&
add x,y*160
setbyte g510&,x,pixel+127
}
g510.refresh(long disp){
LogiLcdMonoSetBackground(g510&,8192)
LogiLcdUpdate(1)
}
Video: Herunterladen
Exe: Herunterladen
Nachtrag:
Viel schöner wäre doch direkt ein hPic an das LCD senden zu können, bitteschön:

{$cleq}
//g510s lcd (160x43x1) display usage with xprofan
decimals 0
declare g510&,g510Pixels&
include pixels.inc
DEF LogiLcdInit(2) ! "LogitechLcd.dll","LogiLcdInit"
DEF LogiLcdIsConnected(1) ! "LogitechLcd.dll","LogiLcdIsConnected"
DEF LogiLcdMonoSetBackground(2) ! "LogitechLcd.dll","LogiLcdMonoSetBackground"
DEF LogiLcdUpdate(0) ! "LogitechLcd.dll","LogiLcdUpdate"
windowstyle 512 | 80
window 0,0 - 0,0
g510.createDisplay()
do {
g510.startPaint()
cls 0
color 15,0
print "XProfan auf G510s"
g510.endPaint()
waitinput 10000
}
end
//
g510.startPaint(){pixels.startPaint(g510Pixels&)}
g510.endPaint(){
pixels.endpaint()
pixels.renewPixels(g510Pixels&)
//pixels.drawSizedHPic(g510Pixels&,0,0,width(hwnd),height(hwnd),0)
g510.pixels2lcd(g510Pixels&)
g510.refresh(1)
pixels.endPaint()
}
nProc g510.pixels2lcd(long pix){
global g510&
long p=0
whileloop 0,6880 {
setbyte g510&,loop,byte(pix,p)
add p,4
}
}
g510.createDisplay(){
usedll("LogitechLcd.dll")
LogiLcdInit("X\zP\zr\zo\zf\za\zn\z.\zN\ze\zt\z\z" ,1)
g510&=globalAlloc(gPTR,8192)
rtlZeroMemory(g510&,8192)
g510Pixels&=pixels.createHPic(160,43,0)
}
nproc g510.cls{
global g510&
rtlZeroMemory(g510&,8192)
}
nproc g510.setPixel(long x,y,pixel){
global g510&
add x,y*160
setbyte g510&,x,pixel+127
}
g510.refresh(long disp){
LogiLcdMonoSetBackground(g510&,8192)
LogiLcdUpdate(1)
}
Und jetzt müsste das Teil gleich noch den letzten Anruf auf meiner FritzBox Mostra... Tada:

Download/ In den Warenkorb4,99 € inkl. MwSt.
keine Versandgebühr |
 |
|
| |
|
|
|
 | Viel schöner wäre doch direkt ein hPic an das LCD senden zu können, bitteschön:

{$cleq}
//g510s lcd (160x43x1) display usage with xprofan
decimals 0
declare g510&,g510Pixels&
include pixels.inc
DEF LogiLcdInit(2) ! "LogitechLcd.dll","LogiLcdInit"
DEF LogiLcdIsConnected(1) ! "LogitechLcd.dll","LogiLcdIsConnected"
DEF LogiLcdMonoSetBackground(2) ! "LogitechLcd.dll","LogiLcdMonoSetBackground"
DEF LogiLcdUpdate(0) ! "LogitechLcd.dll","LogiLcdUpdate"
windowstyle 512 | 80
window 0,0 - 0,0
g510.createDisplay()
do {
g510.startPaint()
cls 0
color 15,0
print "XProfan auf G510s"
g510.endPaint()
waitinput 10000
}
end
//
g510.startPaint(){pixels.startPaint(g510Pixels&)}
g510.endPaint(){
pixels.endpaint()
pixels.renewPixels(g510Pixels&)
//pixels.drawSizedHPic(g510Pixels&,0,0,width(hwnd),height(hwnd),0)
g510.pixels2lcd(g510Pixels&)
g510.refresh(1)
pixels.endPaint()
}
nProc g510.pixels2lcd(long pix){
global g510&
long p=0
whileloop 0,6880 {
setbyte g510&,loop,byte(pix,p)
add p,4
}
}
g510.createDisplay(){
usedll("LogitechLcd.dll")
LogiLcdInit("X\zP\zr\zo\zf\za\zn\z.\zN\ze\zt\z\z" ,1)
g510&=globalAlloc(gPTR,8192)
rtlZeroMemory(g510&,8192)
g510Pixels&=pixels.createHPic(160,43,0)
}
nproc g510.cls{
global g510&
rtlZeroMemory(g510&,8192)
}
nproc g510.setPixel(long x,y,pixel){
global g510&
add x,y*160
setbyte g510&,x,pixel+127
}
g510.refresh(long disp){
LogiLcdMonoSetBackground(g510&,8192)
LogiLcdUpdate(1)
}
Und jetzt müsste das Teil gleich noch den letzten Anruf auf meiner FritzBox Mostra... Tada: [...] 
 |
|
|
| |
|
|
|
 | Und weils so schön ist:

Nu aber genug mit G510-Tastaturkram...
trotzdem tolles Teil! |
|
|
| |
|
|