Digistump Forums
The Digispark => Digispark (Original) Support => Topic started by: skuffle on February 22, 2015, 09:57:23 am
-
I've spent a few hours following the instructions on the wiki in an attempt to get DigiUSB working. Any help would be appreciated :)
In one of the guides it states 'On the computer side you can use the included command line tools in the DigiUSB Programs folder:'
Where is this DigiUSB Programs folder on a Windows install of the Digipark Arduino IDE? I can't find it in C:\Program Files (x86)\Digistump_Arduino
Also, I wondered if I needed a separate download, but looking here 'https://github.com/digistump/DigisparkExamplePrograms' it states 'Example programs for the DigiUSB library - superseded by DigiCDC VUSB Serial Emulation'
Where can I find this 'DigiCDC VUSB Serial Emulation' that it refers to?
I simply want to switch a pin on and off via a Windows command line :(
-
Needed sample are installed - on my system they are here:
C:\Users\YourName\Documents\Digistump_Arduino\hardware\digistump\avr\libraries\DigisparkCDC\examples
I'm not sure what "command line tools" are at hand? The IDE uploads the sketch, then you run Serial Monitor to see the output from the sketch and to send characters to the sketch.
-
Thank you for the reply :)
I don't have a Digistump_Arduino folder in
C:\Users\(myname)\Documents\
The only place I could find this folder was
C:\Program Files (x86)\Digistump_Arduino\hardware\digistump\avr\libraries\DigisparkCDC\examples
In here, there are the .ino sketches that upload to the Digispark (I've done this bit without any problems), but I'm looking for the send.exe and receive.exe that are mentioned in some of the walkthroughs that I can use to communicate with the Digispark from a Windows command line.
I have been using DigiUSBExample up until now - should I be using the DigisparkCDC examples to communicate over USB with the Digispark?
Is this where I am going wrong? Am I using a deprecated example? This wasn't very clear in the 'starter' guides I have been following :(
-
Thanks Ralf - much appreciated - that's what I was looking for, don't know if I would have ever found it myself hiding away there :)
-
@Ralf
maybe you remember well since here
https://github.com/digistump/DigisparkExamplePrograms/tree/master/Python/DigiUSB/windows
there are some windows executables
-
Ttiny85s The master of all Controllers.
After Long term of serch and investigate i have found this article in this thread Points to the
http://sourceforge.net/projects/digistump/files/DigisparkArduino-Win32-1.0.4-May19.zip/download
her we find the correct parameters for msg command.
Wehn u install the sample digispark/usb/echo !
on PC the part is communicative without serial and fifo it is so wonderfull !
Pseudo Code pc side showing what for Parameters do what with that example.
usb_init(); // initialize the library
usb_find_busses(); // find all busses
usb_find_devices(); // find all connected devices
if (!(dev = open_dev()))
{
printf("error opening device: \n%s\n", usb_strerror());
return 0;
}
BYTE n = 0;
while (1)
{
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'H' , 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'a', 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'l', 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'l', 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'o', 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, 'H', 0, 0, 1000);
ret = usb_control_msg(dev, (0x01 << 5), 0x09, 0, '\n', 0, 0, 1000);
tmp[0] = 0;
while ((ret = usb_control_msg(dev, (0x01 << 5) | 0x80, 0x01, 0, 0, &tmp[0], 1, 1000)) > 0)
{
printf("%s", &tmp[0]);
}
}
so nice thanks for this thread