The software is ordered here:
http://cippsites.com/Merchant4/merch...re_Code=melabs
Robert
![]()
The software is ordered here:
http://cippsites.com/Merchant4/merch...re_Code=melabs
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
EasyHID Wizard is completely free. It is not time limited in any way and it does not have any nag screens!
http://www.mecanique.co.uk/products/usb/easyhid.html
Been there done that, still can't get it to work. It's like some stuff is still missing. I tried making a simple keyboard using the examples that are floating about in here and several other sites, couldn't get it happening after a lot of hours.
So I gave up until I'll have enough money for the software, which ain't tomorrow...
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Hi Rob,
That HIDMaker FS Software looks really good... but I would have to sell the House Cat in order to afford it!
What we really want is a step by step guide how to write USB code in Picbasic Pro.
Easy HID is a good start but as you say, there are too many blanks.
I ordered my free chips from Micro chip... thanks for the Tip.
Cheers
Jared
Jared,
I might be able to get it and still keep my 2 house cats, Garfield and Scotchtape.I have a cheque coming in for a yet unknown amount of money, hoping for a late Christmas present from the gods.
I'll report back with a basic skeleton if I'm lucky; at least a simple transmission of one byte from the PIC to PC. Once you have a working sample running, it shouldn't be hard to increase bufer size to custom spec. My application is simulating a keyboard, so I only need one VB command to simulate a keystroke (or sequence of keystrokes).
I'm still unsure on how much PC-side material this software will deliver. If I had been smart, I would have spent the last month or so putzing around with Visual Basic, getting myself familiar with its intricacies. I know BASIC, but VB has a lot more power to it, let alone all the Windows crap that goes along with it.
But hey, procrastination is my middle name...
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Robert,
Garfield and ScotchTape, Let me guess, one cat is Fat and Lazy, the other is a Skinny Minnie and very loud?! haha
Our cat is the later.
I digress, Yep, I rekon if we can simulate a key press, it should be a sinch from there.
Cheers
J
Using easyhid is not that bad.
Basic steps are run up the easyhid program and set the basics like Pid/Vid and buffer size for bytes you want to send back and forth from PC to Pic.
It then by default creates two folders under a top level folder called USBProject
The first folder is PICBasicPRO
This contains the basic code you will need for your pic chip and the include files, do not rename or move this directory once it is created, work from this location.
It will create a example PBP file called USBProject.pbp
So open this up and the main program loop you are interested in is:
'****************************************
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
gosub DoUSBOut
goto ProgramStart
'*****************************************
For receving and sending data you just need these two routines.
If you wanted to receive say 10 bytes then it does matter that your buffer is set to 64 bytes because that is the packet size that is going to be received from the PC anyway, so do not worry about this. Just tell it to jump off to that routine and as soon as data is received it will come back from that routine with the usbbuffer(0) to usbbuffer(63) filled as such.
So if your PC sent 10 bytes then the variables usbbuffer(0-9) will hold those 10 bytes, if your pc sent 20 bytes then usbbuffer(0-19) will hold those bytes.
So say you wanted to send 4bytes from your PC to the Pic and then the Pic displays it on the LCD, you could do this:
'*******************************************
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
LCDOUT $FE,1,usbbuffer(0),usbbuffer(1),usbbuffer(2),usbbu ffer(3)
goto ProgramStart
'*******************************************
If you then wanted to send say two bytes back to the PC to say you received them, then just load up your usbbuffer variables and jump to the routine gosub DoUSBOut.
So to send "OK" back to the PC add this to your code.
'*******************************************
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
LCDOUT $FE,1,usbbuffer(0),usbbuffer(1),usbbuffer(2),usbbu ffer(3)
usbbuffer(0)=79 'Ascii value for O
usbbuffer(1)=75 'Ascii value for K
gosub DoUSBOut
goto ProgramStart
'*******************************************
And thats ya simple pic code to receive and send bytes back and forth. Now you know how to get your bytes in and out, you can use them just like any other variables.
The Second Folder it creates is dependent on what you are developing in, I play with Visual Basic so it created me a Folder called VisualBasic and inside here is sample code and the files you will need, I aslo copy the file mcHID.dll from C:\Program Files\Mecanique\EasyHID\ into this folder as well to play safe.
So again for the VB side of things to send data out to the Pic via the USB Port you simply load up the Bufferout(1-64) you always send Bufferout(0)=0 as a header.
So to send 4 bytes from Visual Basic just use the following:
'*******************************************
BufferOut(0) = 0
BufferOut(1) = 68 'Ascii Value for D
BufferOut(2) = 65 'Ascii Value for A
BufferOut(3) = 84 'Ascii Value for T
BufferOut(4) = 65 'Ascii Value for A
hidWriteEx VendorID, ProductID, BufferOut(0)
'*******************************************
To receive Data in VB, the sample code basically sits there and waits for a recieve event to happen and when it does, it jumps off to a routine called OnRead and populates the variables BufferIn(1-64).
So you could do a simple loop to keep checking the value of BufferIn(1) and BufferIn(2) until they receive the "OK\2 back.
To see it in action set up a object called Text1.Text on your VB Form and then in your code add the following:
'*******************************************
Text1.Text = Chr(Val(BufferIn(1)))
Text1.Text = Text9.Text & Chr(Val(BufferIn(2)))
'*******************************************
Hope this helps.
Regards Sean.
Last edited by sean-h; - 6th February 2006 at 19:54.
Bookmarks