Program for Microcontroller

Hello there,

I'm new Arduino and trying to program for Attiny13a microcontroller for Servo.

I have connect succesfully 13a microcontroller with arduino and light is blinked after select board.

My question is I have program code for this project but how can I upload this code with Arduino?

Is it possible copy/paste and am I need change any line in this code?

Here is the code;

//Servo2 ATtiny13A clock:9.6MHz 20131020 0600
#include <avr/io.h>
#include <avr/interrupt.h>

void wait(uint16_t w){while(w--){volatile uint16_t i=1;while(i--);}}
int a,b=150,c=1,e=90,f=194,k;

ISR(TIM0_COMPA_vect){  //timer interrupt
    a++;
    if(a<=b){PORTB|=(1<<PB0);}else{PORTB&=~(1<<PB0);}
    if(a>=2010){a=0;}
}

int main( void ){

    DDRB  =0b00000111;  //PB4:speed,PB3:switch,PB2 PB1:LED,PB0:OC0A
    PORTB =0b00011000;

    TCCR0A=0b00000010;  //CTC
    TCCR0B=0b00000001;  //
    OCR0A =93;      //93:50Hz
    TIMSK0=0b00000100;  //compare match A interrupt enable
    sei();      //interrupt enable

while(1){

    if(~PINB & 0b00001000){c=1;}else{c=-1;}
    if(~PINB & 0b00010000){k=500;}else{k=2000;}
    wait(k);
    b=b+c;
    if(b<e){b=e;PORTB|=(1<<PB1);}else{PORTB&=~(1<<PB1);}
    if(b>f){b=f;PORTB|=(1<<PB2);}else{PORTB&=~(1<<PB2);}

Check out this IDE add-in to make that easier:

Cross posted at http://arduino.stackexchange.com/q/32113/26916

That code is incomplete and will not compile. You will need to find the rest of the code.

how can I upload this code with Arduino?

Since the tiny13 is too small to use a bootloader, you will need some sort of device programmer (like an Arduino running the ArduinoISP sketch), and you'd use the "upload using programmer" feature of the Arduino IDE. (that's AFTER you install the microCore add-in.)

OTOH, the code you posted is not an Arduino sketch for any microcontroller, so that might not be the best way to proceed.

Cross posted at http://arduino.stackexchange.com/q/32113/26916

I don't really regard posting at multiple independently-administered forums to be a problem, and I don't really consider it "cross posting." Different people read different forums, and you get different replies. (It would be nice if the original poster make sure that any final answer they get ends up being documented on all of the forums that they posted the question...)