주 메뉴 바로가기 본문 컨텐츠 바로가기 ABOUT MODI 바로가기 MODI 패키지 바로가기 MODULES 바로가기 CREATION 바로가기 STUDIO 바로가기

MODI user Creation

lnb, filtering

  • 18.09.15 (토) 10:34
  • 조회수 183
  • 좋아요 1
creation

Digital Music Box

난이도

사용한 모듈

  • 사용한 모듈

    초음파x1

  • 사용한 모듈

    스피커x1

  • 사용한 모듈

    배터리x1

  • 사용한 모듈

    네트워크x1

준비물

MODI + many 2x1 Lego blocks, long 4x20 bottom block(one or two), two wheels, and some addition Lego blocks.

1. Input - Ultrasonis module; Ultrasonic sensor  is used for measuring how far the object is placed in front of it and expected application is the digital height meter, water level checker and proximity detector which is installed most of car to avoid any collision.

 

2. Process - Read the distance from Ultrasonic sensor and amke a series of conditional "if" to generate a sound( Do, Re Mi, Pa...) according to the distance reading.

 

3. Output - Speaker module; Play the sound of  Do, Re Mi.. according to the distance of sensing object and work like a music box.

 

This project a quit simple but show the typical concept of what is the input for the system and what is the output of it. To make a different distance object as a input, 2x1 lego block would be located in a row and Ultrasonic module read each distances on the two wheel rover and play the sound using Speaker Module.

Original plan to play the sound of music box on "Mr. Sunshine" but the Ultrasonic sensor's reading was not so accurate as expected.

  • user profile
    SeanKim

    while(true)
    {
    if(ultrasonic0.getDistance()<=45)
    {
    speaker0.setTune(F_DO_6, 50);
    }
    else if(ultrasonic0.getDistance()>45 && ultrasonic0.getDistance()<=90)
    {
    speaker0.setTune(F_RE_6, 50);
    }
    else if(ultrasonic0.getDistance()>90 && ultrasonic0.getDistance()<=135)
    {
    speaker0.setTune(F_MI_6, 50);
    }
    else if(ultrasonic0.getDistance()>135 && ultrasonic0.getDistance()<=180)
    {
    speaker0.setTune(F_PA_6, 50);
    }
    else if(ultrasonic0.getDistance()>180 && ultrasonic0.getDistance()<=225)
    {
    speaker0.setTune(F_SOL_6, 50);
    }
    else if(ultrasonic0.getDistance()>225 && ultrasonic0.getDistance()<=270)
    {
    speaker0.setTune(F_RA_6, 50);
    }
    else if(ultrasonic0.getDistance()>270 && ultrasonic0.getDistance()<=315)
    {
    speaker0.setTune(F_SI_6, 50);
    }
    else if(ultrasonic0.getDistance()>360 && ultrasonic0.getDistance()<=405)
    {
    speaker0.setTune(F_DO_7, 50);
    }
    else if(ultrasonic0.getDistance()>405)
    {
    speaker0.setTune(F_RE_7, 50);
    }
    else
    {
    speaker0.setTune(F_PA_5, 0);
    }
    sleep(100);


    sleep(1);
    }

    좋아요 0

    70.01.01 (목) 09:00

  • user profile
    SeanKim

    Would like to export the MODI project but don't know which way is the best. Then instead, I just posted CUI version of MODI project then anyone easily implements by themselves. However, if there is a way to export MODI project here, then let me know. Thanks.

    좋아요 0

    70.01.01 (목) 09:00