с Си на Баш

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by megahertz, 25 Feb 2016.

  1. megahertz

    megahertz New Member

    Joined:
    3 Sep 2015
    Messages:
    4
    Likes Received:
    0
    Reputations:
    0
    Друзья,
    есть кодеры на линухах? помогите перевести сишный код под bash
    к сожалению с линухами дико на вы:(
    int t_on, t_off;
    int d=1,i=1;
    for(;; )
    {
    t_on=50*d;
    t_off=50*(100-d);
    digitalWrite(1, LOW);
    delayMic(t_on);
    digitalWrite(1, HIGH);
    delayMic(t_off);
    if (d==100){i=0;}else if(d==0){i=1;}
    if (i==1){d++;}else{d--;}
    }
    return 0;
     
    #1 megahertz, 25 Feb 2016
    Last edited: 25 Feb 2016
  2. megahertz

    megahertz New Member

    Joined:
    3 Sep 2015
    Messages:
    4
    Likes Received:
    0
    Reputations:
    0