initial commit with all the stuff

This commit is contained in:
2025-11-23 13:27:23 +01:00
parent 3f7069b328
commit 1c8a143e7a
5241 changed files with 986176 additions and 0 deletions

45
2B+Software/app/touch.lua Normal file
View File

@@ -0,0 +1,45 @@
local evdev = require "evdev"
local dev = evdev.Device("/dev/input/event0")
local x = 0
local y = 0
local cnt = 0
while true do
--local timestamp, eventType, eventCode, value = dev:read()
--print(dev:avail())
if dev:avail() > 0 then
local timestamp, eventType, eventCode, value = dev:read()
if eventType == evdev.EV_ABS then
if eventCode == 57 then
if value < 0 then
if y > 0 and y < 79 then
print("Ctrl1: ",math.floor(x/80)+1)
end
if y > 400 and y < 479 then
print("Ctrl2: ",math.floor(x/80)+1)
end
if y > 320 and y < 399 then
print("Numbs: ",math.floor(x/80)+1)
end
if y > 80 and y < 319 then
-- print("Lines: ",math.floor(y/((320-80)/6))-1,math.floor(x/20)+1,x,y,math.floor((y-80)/240*10+6),math.floor(x/465*23+5))
print("Lines: ",math.floor((y-80)/240*10+6),math.floor(x/720*36+7))
end
end
elseif eventCode == 0 then
x = value
elseif eventCode == 1 then
y = value
end
end
else
cnt = cnt + 1
end
end