1.  Here we go. The challenge is reading serial data and store it in string, but fortunately there is readString command, :)

    (I take the shoot from Photo Booth on my Mac)




    #include <LiquidCrystal.h>

    .
    LiquidCrystal lcd(12, 11, 5, 4, 3, 2);//rs e d4 d5 d6 d7
    String tulisan = "Tadaa...";
    void setup() {
      lcd.begin(16, 2);
      lcd.print(tulisan);
      Serial.begin(9600);
      delay(1000);
    }
    
    void loop() {
      if (Serial.available()){
        lcd.clear();
        while(Serial.available()>0){
          tulisan=Serial.readString();
          lcd.print(tulisan);
        }
      }
      // scroll 13 positions (string length) to the left
      // to move it offscreen left:
      for (int i = 0; i < tulisan.length(); i++) {
        // scroll one position left:
        lcd.scrollDisplayLeft();
        // wait a bit:
        delay(150);
      }
    
      // scroll 29 positions (string length + display length) to the right
      // to move it offscreen right:
      for (int i = 0; i < (tulisan.length()+16); i++) {
        // scroll one position right:
        lcd.scrollDisplayRight();
        // wait a bit:
        delay(150);
      }
    
      // scroll 16 positions (display length + string length) to the left
      // to move it back to center:
      for (int i = 0; i < 16; i++) {
        // scroll one position left:
        lcd.scrollDisplayLeft();
        // wait a bit:
        delay(150);
      }
    
      // delay at the end of the full loop:
      delay(1000);
    
    }
    
    
    .


    Menampilkan dan men-scroll text yang diketik menggunakan monitor serial di arduino nano.

    Tantangannya adalah membaca serial data dan menyimpannya sebagai string. Di versi lama, kita harus membaca komunikai serial sebagai char yang tentu saja sangat merepotkan. Untungnya kita mempunyai perintah readString, :)

    0

    Add a comment

  2.  After subconsciously try it on my debian machine about a week, now when I have a chance to write on arduino IDE on my Macbook, it wont upload the sketch, no port for nano.

    installing FTDI driver didn't help because it use CH340G chip for com.

    Grab the driver from http://www.wch.cn/downloads.php?name=pro&proid=178

    install it

    restart,

    no change, :(

    found out that we have to run this on terminal

    sudo nvram boot-args="kext-dev-mode=1"

    reboot,

    yup, the life is easier again, :)







    0

    Add a comment

  3. Menggunakan HC-05

    Arduino Nano

    Menyalakan LED 13 (blink tanpa delay)

    Menyalakan LED 3 dengan mode PWM dengan perintah analogRead, sehingga nyala LED berangsur-angsur dari redup ke terang ke redup lagi (255 tingkat kecerahan).

    Menyalakan LED 2 dengan perintah  melalui port serial bluetooth dari Mac OS X.

    (program ditulis dan dijalankan di linux Debian)

    led pin 3 dapat dinyalakan (setelah microcontroler tersambung dengan komputer via bluetooth) dengan mengetikkan 'nyala' atau 'mati' pada konsole di komputer.




    #include <softwareserial .h>

    SoftwareSerial hc05(11,12); //RX TX
    
    String baca;
    
    int t=0;
    int dt=1;
    void setup() {
      hc05.begin(9600);
      hc05.println("Tadaa...");  
      pinMode(13, OUTPUT);   
      pinMode(2, OUTPUT);  
    }
    
    void loop() {
      t+=dt;
      //hc05.print("nilai t = ");
      //hc05.println(t);
      while (hc05.available()){
        char c = hc05.read();
        baca += c;
      }
      if(baca.length()>0){
        hc05.println(baca);
        if (baca.indexOf("nyala")>=0){
          digitalWrite(2,HIGH);
        }
        if (baca.indexOf("mati")>=0){
          digitalWrite(2,LOW);
        }
      }
    
      baca="";
      if(t>=255){
        dt=-1;
        digitalWrite(13, LOW);
      } 
      if(t<=0){
        dt=1;
        digitalWrite(13,HIGH);
      }  
      analogWrite(3,t);
      delay(27);              
      }
    
          

    .






    0

    Add a comment

  4.  It's interesting watching Rossi's fighting a mob of Ducati riders and hunting the sliding and panicking Marquez Honda. 

    The extra hard tires help though.

    Sadly, the excecution's not smooth. 

    Rossi, Dovi, Ianonne.
    0

    Add a comment


  5. Dengar lagu ini sejak kecil,  sekitar umur tiga atau empat tahun, sebelum TK. Mulai searching lagu ini sejak tahun kedua kuliah, dan ketemu kemarin sore jam setengah lima, dua belas tahun kemudian, :)

    Woman in Love



    Life is a moment in space
    When the dream is gone
    It's a lonelier place
    I kiss the morning good-bye
    But down inside
    You know we never know why

    The road is narrow and long
    When eyes meet eyes
    And the feeling is strong
    I turn away from the wall
    I stumble and fall
    But I give you it all

     I am a woman in love
    And I'd do anything
    To get you into my world
    And hold you within
    It's a right I defend
    Over and over again
    What do I do?

    With you eternally mine
    In love there is
    No measure of time
    They planned it all at the start
    That you and I
    Live in each others heart

    We may be oceans away
    You feel my love
    I hear what you say
    No truth is ever a lie
    I stumble and fall
    But I give you it all

     I am a woman in love
    And I'd do anything
    To get you into my world
    And hold you within
    It's a right I defend
    Over and over again
    What do I do?

    I am a woman in love
    And I'm talkin' to you
    You know I know how you feel
    What a woman can do
    It's a right I defend
    Over and over again

    I am a woman in love
    And I'd do anything
    To get you into my world
    And hold you within
    It's a right I defend
    Over and over again
    What do I do?
    0

    Add a comment

  6. Velocity is set by dragging box. Process begin when the press on the box is released.

    The 'Pig' animation is triggered whenever hitTest between 'kotak' and 'pigpig' returned true value


    0

    Add a comment

  7. We could write code in it, connecting parts on breadboard (or project-board), auto-route it to schematic and pcb layout (single or double layer).

    It has several arduino board ready on parts section







    Dengan Fritzing, kita bisa menulis kode mikrocontroler di sini, memasang komponen dan menyambung dengan kabel di project-board, kemudian me-route secara otomatis menjadi skematik seperti di EWB (Electronic Work Bench), routing otomahis juga dilakukan untuk menghasilkan layout PCB seperti di Protel (mendukung single dan double-layer)
    0

    Add a comment

  8.  

    I immediately saw that the first corner  is ridiculously tricky

    Well, almost all corners are, :)

    (Very weird circuit layout)

    And I'm sure the delay due to water spillage at turn 3, which is not present at the Moto2 race, break the mood of all. 

    (Where is it come from? The bridge?)

    Honda goes without saying

    Battle happened between Yamaha and Ducati for 2nd (Rossi n Dovi) and for 4th (Lorenzo n Ianone)

    Used to delivered just power, now apparently ducati cornering's improved 

    With Yamaha have just cornering advantage, and still unsolved the front tire problem,  it obvious that Rossi have to give it all in his trick bag, and yet he's still struggling to just keep in second.

    0

    Add a comment

  9.  

    Senang melihat keceriaan para pembalap di lintasan

    (Juga aksi Marquez yang merebut pole dengan motor cadangan, tentu saja)
    0

    Add a comment

  10. Well, not for all, but for me it becomes problem while turning led on using analogWrite command, some led just won’t completely shut down.

    (Maybe it completely unrelated, but my analog reading on A0 is oscillating, very unstable)



    I have the commands packed on a function

    unsigned long t0 = 0;
    const long dt = 1000;       
    void blinkNoD(int pin) {
      unsigned long t = millis();
      if(t - t0 >= dt) {
        t0 = t;
        led=!led;   
        digitalWrite(pin, led);
      }
    } 
    
    


    Since I already have delay in loop, and it really messed with the timing (not mention that maybe the analog reading instability have anything to do with it), I decided to modify the blink code, still without delay command.

    unsigned long t0 = 0;
    const long dt = 1;       
    void blinkNoD(int pin) {
      t0 += dt
      if(t0 >= 4) {
        t0 = 0;
        led=!led;   
        digitalWrite(pin, led);
      }
    } 
    
    
    It turned out that my analogRead instability is another problem, get to work on it, :)


    0

    Add a comment

Archive
Label
Popular Posts
Popular Posts
Loading