ok, after some digging, i installed Win-AVR (yawn)... even now 6 hours later, still not really that much further than i was 6 hours ago!
So, i decided to look for someway of getting Arduino to handle it instead of WinAVR, anyway i found a guy who did it, and the code COMPILES amazingly
even though he made it 2 years ago!
Problem 1. sort of fixed.
Problem 2. What i'm trying to do is get the Attiny85 to work with it so i "select" Attiny85, it's a modified board file i did sometime ago and it works nicely,
now then if only I could figure out how to get it to play nicely and compile code in Arduino!
If you extract both zips, attiny to the hardware and the Port of VUSB to the Library folder and run the example, it compiles just fine undero uno, but
when i select my attiny85 it fails to compile
um, any clues?
If we/you someone can fix it, it would mean the ability to turn an Attiny85 into a USB HID device with Arduino! who would not find that useful!
Errors
#include "UsbKeyboard.h"
#define BUTTON_PIN 12
// If the timer isr is corrected
// to not take so long change this to 0.
#define BYPASS_TIMER_ISR 1
void setup() {
pinMode(BUTTON_PIN, INPUT);
digitalWrite(BUTTON_PIN, HIGH);
#if BYPASS_TIMER_ISR
// disable timer 0 overflow interrupt (used for millis)
TIMSK0&=!(1<<TOIE0); // ++
#endif
}
#if BYPASS_TIMER_ISR
void delayMs(unsigned int ms) {
/*
*/
for (int i = 0; i < ms; i++) {
delayMicroseconds(1000);
}
}
#endif
void loop() {
UsbKeyboard.update();
digitalWrite(13, !digitalRead(13));
if (digitalRead(BUTTON_PIN) == 0) {
//UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);
UsbKeyboard.sendKeyStroke(KEY_H);
UsbKeyboard.sendKeyStroke(KEY_E);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_O);
UsbKeyboard.sendKeyStroke(KEY_SPACE);
UsbKeyboard.sendKeyStroke(KEY_W);
UsbKeyboard.sendKeyStroke(KEY_O);
UsbKeyboard.sendKeyStroke(KEY_R);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_D);
//UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);
UsbKeyboard.sendKeyStroke(KEY_ENTER);
#if BYPASS_TIMER_ISR // check if timer isr fixed.
delayMs(20);
#else
delay(20);
#endif
}
}
Errors.
In file included from UsbKeyboardDemo1.cpp:1:
C:\Arduino\arduino-1.0.1\libraries\UsbKeyboard/UsbKeyboard.h: In constructor 'UsbKeyboardDevice::UsbKeyboardDevice()':
C:\Arduino\arduino-1.0.1\libraries\UsbKeyboard/UsbKeyboard.h:131: error: 'PORTD' was not declared in this scope
C:\Arduino\arduino-1.0.1\libraries\UsbKeyboard/UsbKeyboard.h:132: error: 'DDRD' was not declared in this scope
UsbKeyboardDemo1.cpp: In function 'void setup()':
UsbKeyboardDemo1.pde:-1: error: 'TIMSK0' was not declared in this scope
Both the Libraries for VSB and the hardware mod for the Attiny85 i've attached here, everyone and their dog should be able
to compile and run this, now for the attiny85
attinyownmods hardware folder.zip (2.4 KB)
vusb-for-arduino-005 Libraries.zip (347 KB)