Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Zakladni program GPS")
- -- cil programu:
- -- umet dojet na urcene misto
- -- umet nacitat prikazy pres wifi
- -- umet nakrmit hladovou Turtlu :)
- --start
- --cilove souradnice:
- xc = -128
- yc = 65
- zc = 252
- --zjisteni aktualni polohy
- local x,y,z = gps.locate(5)
- print(x)
- print(y)
- print(z)
- -- vzlet nahoru jako do Japonska
- for y = 1,15,1 do
- turtle.up()
- print("Turtla jede nahoru patro:")
- print(y)
- end
- while true do
- -- porovnani polohy
- if xc > x then
- -- xc = xc -1
- turtle.back()
- end
- if xc < x then
- turtle.forward()
- end
- --if yc > y then
- --turtle.up()
- --end
- --if yc < y then
- --turtle.down()
- --end
- if zc > z then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- if zc < z then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement