Jump to content

Controlo do carro telecomandado peloa LPT


Jpab
 Share

Recommended Posts

ja anvancei mais desde a ultima vez que postei info sobre o projecto... estou na parte da eletronica nao esta fiacil :S

vejam o codigo que eu fiz e vejam porfavor se detectam algum erro já que eu ainda nao posso testar o  programa porque a parte da eletronica esta a demorar. se detectarem digam que nao detectarem digam que nao detectaram.

aqui vai o codigo

da parte do controlo da porta:

'declaraçoes
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Private Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)


'desativo todos os pinos ao iniciar

Private Sub Form_Load()
Dim ValOut As Byte
Out 888, 0
End Sub

'quando carrego nas teclas:

Private Sub Frente()
Dim ValOut As Byte
Out 888, 1
End Sub

Private Sub traz()
Dim ValOut As Byte
Out 888, 2
End Sub

Private Sub Esquerda()
Dim ValOut As Byte
Out 888, 4
End Sub

Private Sub Direita()
Dim ValOut As Byte
Out 888, 8
End Sub

Private Sub cidi()
Dim ValOut As Byte
Out 888, 9
End Sub

Private Sub diba()
Dim ValOut As Byte
Out 888, 10
End Sub

Private Sub esba()
Dim ValOut As Byte
Out 888, 6
End Sub

Private Sub cies()
Dim ValOut As Byte
Out 888, 5
End Sub

Private Sub para()
Dim ValOut As Byte
Out 888, 0
End Sub

se puderem deem uma vista de olhos thanks

😛

Link to comment
Share on other sites

agora o meu problema é como gravar imagens que tao no vb para o pc.. do tipo

eu tenho este codigo num botao:

SavePicture Picture1.Image, "c:\Foto.jpg"

so que este codigo so dá para gravar um ficheiro... quando quero guardar nova foto carrego no botao e emvez de guardar em um novo ficheiro substitui o anterior :S

tenho de arranjar outra forma de gravar as fotos :S

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.