I have a cnc machine project going on that runs off mach3mill and i need to add a remote to it,
its a simple 2 button (start and stop) and wanted to program up a digispark board that will emulate itself as a 2 key keyboard as i can hotkey commands within mach3mill so keystrokes.
but im a little stumped as to where to begin. i looked at the digikeyboard but the example isnt exactly clear as to how to go about it.
the digispark board would be plugged into the laptop obviously.
yes however when i check in the library manager i get only belgian or french keyboards when searching for “digikeyboard”
as for the other options i dont know where to download the zip for the library mentioned, or the web address to enter it into the other screen where it will download it itself.
okay i got the libary, when verifying your code i get these errors
In file included from C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:13:0,
from C:\Users\ryder\AppData\Local\Temp\arduino_modified_sketch_419351\Keyboard.ino:1:
c:\users\ryder\documents\arduinodata\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>." [-Wcpp]
#warning "This file has been moved to <util/delay.h>."
^~~~~~~
In file included from C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:16:0,
from C:\Users\ryder\AppData\Local\Temp\arduino_modified_sketch_419351\Keyboard.ino:1:
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:479:26: error: variable 'usbDescriptorDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char usbDescriptorDevice[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:485:33: error: variable 'usbDescriptorConfiguration' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char usbDescriptorConfiguration[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:491:29: error: variable 'usbDescriptorHidReport' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char usbDescriptorHidReport[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:497:27: error: variable 'usbDescriptorString0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char usbDescriptorString0[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:503:31: error: variable 'usbDescriptorStringVendor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
int usbDescriptorStringVendor[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:509:31: error: variable 'usbDescriptorStringDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
int usbDescriptorStringDevice[];
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/usbdrv.h:515:37: error: variable 'usbDescriptorStringSerialNumber' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
int usbDescriptorStringSerialNumber[];
^
In file included from C:\Users\ryder\AppData\Local\Temp\arduino_modified_sketch_419351\Keyboard.ino:1:0:
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:40:73: error: variable 'usbDescriptorHidReport' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PROGMEM char usbHidReportDescriptor[USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH] = { /* USB report descriptor */
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '161' from 'int' to 'char' inside { } [-Wnarrowing]
};
^
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '224' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '231' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing]
Using library DigisparkKeyboard in folder: C:\Users\ryder\Documents\Arduino\libraries\DigisparkKeyboard (legacy)
exit status 1
Error compiling for board ATtiny85 (Micronucleus / DigiSpark).
I have also worked with this board. Now, kindly explain you project. Where do you want to connect the 2-key and with which device you want to communicate with these2-key?
i’ll explain from the main post the requirements again,
2 momentary buttons will be connected, likely pin 0 and 1 and ground. the board will be plugged into a usb extension cable and connected to a laptop running mach3mill.
the chip needs to pickup the button presses and relay that to the laptop as keyboard key strokes
You need an application at the PC side that will sense the closing position of a key with the ATtiny85. Also, you need firmware at the ATtiny85 side to sense the closing position of a key and relay that status to PC via USB Port. Do you have these applications ready or you are trying to make them?
the idea is that the digispark can be plugged into the pc, recognised as a usb keyboard and the buttons are the keyboard keys as i only require 2 “keys” im trying to avoid additional software on the laptop and keep it built into the digispark
Have you Googled to get help? I See from this link Google Search what Google can offer you? There is a lot of works involved which if done with patience, the project can be realized.
You need additional software at PC side to catch the key stroke going to PC and then send it to your traget Device via another USB Port.
Connect two UNOs with PC. Read a character from the InputBox of IDE1 of UNO-1 and then send it to the OutputBox of IDE2 of UNO2. You can't do it directly. You need a 3rd Software for your PC that will work as a Mediator.
Solve the exercise of post #18 and then apply it in your ATtiny85 project.
You can connect your 2-key ATtiny85 using a TTL/USB converter with PC. Get a Mediator Software for you PC to read key strokes from ATtiny85 and then send them to your target device.