Code compilation help needed .

Hello everyone ,

I would really like some help and I dont know if this is the exact place to ask for it but i thought you guys could point me somewhere, i have an at90usb162 , this one to be more precise:

Now i want to compile some code to it, but the only thing i know how to do is load an hex file to it with Flip 3.4 , so here I am stuck since the only code i found is for something called Teensy and the Arduino…

And here the code :

#include <usb_keyboard.h>
// This code is licensed under Apache 2.0 License
// http://www.apache.org/licenses/LICENSE-2.0.txt
// Limitation of Liability. In no event and under no legal theory,
// whether in tort (including negligence), contract, or otherwise,
// unless required by applicable law (such as deliberate and grossly
// negligent acts) or agreed to in writing, shall any Contributor be
// liable to You for damages, including any direct, indirect, special,
// incidental, or consequential damages of any character arising as a
// result of this License or out of the use or inability to use the
// Work (including but not limited to damages for loss of goodwill,
// work stoppage, computer failure or malfunction, or any and all
// other commercial damages or losses), even if such Contributor
// has been advised of the possibility of such damages.
// This code is indented for people who are not able to contact
// apple support and I am in no way liable for any damage or
// problems this code might cause.
const int ledPin = 13; // choose the pin for the LED
int counter = 0;
int fakecounter = counter;
char pin[]="xxxx";
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
delay(10000);
}
void loop(){
keyboard_modifier_keys = 0;
if (counter <= 9999){
delay(8000);
digitalWrite(ledPin, LOW);
delay(5500);
digitalWrite(ledPin, HIGH);
sprintf(pin, "%04d", fakecounter);
//sending first digit
Keyboard.press(pin[0]);
delay(450);
Keyboard.release(pin[0]);
delay(420);
//sending second digit
Keyboard.press(pin[1]);
delay(398);
Keyboard.release(pin[1]);
delay(510);
//sending third digit
Keyboard.press(pin[2]);
delay(421);
Keyboard.release(pin[2]);
delay(423);
//sending forth digit
Keyboard.press(pin[3]);
delay(430);
Keyboard.release(pin[3]);
delay(525);
//sending enter
Keyboard.press(KEY_ENTER);
delay(305);
Keyboard.release(KEY_ENTER);
}
//reached 4 digit PIN max value
if (counter > 9999){
for (int blinkies = 0; blinkies < 8; blinkies++) {
digitalWrite(ledPin, HIGH);
delay(20);
digitalWrite(ledPin, LOW);
delay(200);
}
delay(6000);
}
++counter;
fakecounter = counter;
}

Now I dont know how to get from this code to an hex file,

The backstory to this is I was to rescue a macbook i bought time ago, and got blocked like 2 months after i purchased it in a local (i am albanian) craiglist like site, I have send a lot of emails to apple but since I have only emails as a proof of purchase … they dont even bother (that and the thing I am from a country that many of apple employees hadnt even heard of before)

So … ANY type of help would be appreciated
Thanks in advance

Have you seen the links off this page:- https://www.sparkfun.com/products/retired/8857

Yes i have, i have downloaded all the demo code in C but no clue how convert them in HEx, sorry totally noob in this field…

I am an Network Admin but have no clue in programming sorry

Have you got this? http://www.atmel.com/tools/flip.aspx

Hey Mike ,

Yes i have downloaded flip , but from what i see with Flip i can load only hex to the device, So the point is how to arrive from the code i have pasted on the first post to an compiled hex file to load to the USB with FLIP

Thanks for you time btw , you are a great man :)

i have downloaded all the demo code in C but no clue how convert them in HEx,

You don't convert them your compiler converts them.

I am not sure if the arduino compiler will produce the right code, but to get a hex file from it:- There is an option you can add to preferences.txt to tell Arduino to NOT delete the files. I think it's: export.delete_target_folder=false You then set build output to 'verbose' to get the name and location of the temporary directory.

The problem is i dont have an Arduino, I was hopping somebody who does have an arduino with that particular chip at90usb162 (since i read that there are arduinos witch have that) could compile the code and give me just the hex,.. i know is to much to ask for but just in case somebody had some spare time for me .

SilentSurfer: The problem is i dont have an Arduino, I was hopping somebody who does have an arduino with that particular chip at90usb162 (since i read that there are arduinos witch have that) could compile the code and give me just the hex,.. i know is to much to ask for but just in case somebody had some spare time for me .

I don't believe that the standard arduino IDE supports that chip type, but I could be wrong, I was once. ;)

The problem is i dont have an Arduino,

You don't need one. If it can be compiled on the arduino IDE then just try and load it. The compiler will compile it, save the files and then not be able to upload it. The files will still be there.

who does have an arduino with that particular chip at90usb162 (since i read that there are arduinos witch have that)

Where did you read that. It is not a chip I recognise as being n any arduino product.

:D You know everyone at some point understands how stupid he is :P

Now that i got on track, i download Arduino and TeensyDuino (since the board i was talking came out to be not Arduino but Teensy 1.0) , i did made all the changes required but now I am stuck at an error I cant find any info for :

 This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.5-r2 (Windows 7), Board: "Teensy 1.0"
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s: Assembler messages:
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s:198: Error: illegal opcode mul for mcu at90usb162
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s:203: Error: illegal opcode mul for mcu at90usb162
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s:207: Error: illegal opcode mul for mcu at90usb162
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s:211: Error: illegal opcode mul for mcu at90usb162
C:\Users\BaneBorg\AppData\Local\Temp/cctWlniu.s:237: Error: illegal opcode mul for mcu at90usb162

So now that I am getting more into the topic I am stuck again