[쉽게 배우는 자바] IoT 모의 프로그램 만들기

KingU·2021년 12월 28일
0

쉽게 배우는 자바

목록 보기
2/5
post-thumbnail

🌟 IoT 모의 프로그램 만들기


계기 🤷‍♂️ :


작업 자동화를 체감하기 위하여

실제로 움직이는 것은 아니지만 체감을 하기 위하여






1. Progect 디렉토리에 egoing님의 git에서 패키지를 불러온다


git clone https://github.com/egoing/java-iot.git






2. 소스코드 작성


import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Lighting;
import org.opentutorials.iot.Security;

public class OkJavaGoInHome {

	public static void main(String[] args) {
		
		String id = "JAVA APT 507";
		
		// Elevator call
		Elevator myElevator = new Elevator(id);
		myElevator.callForup(1);
		
		// Security off
		Security mySecurity = new Security(id);
		mySecurity.off();
		
		
		// Light on
		Lighting hallLamp = new Lighting(id+" Hall Lamp");
		hallLamp.on();
		
		Lighting floorLamp = new Lighting(id+" Floor Lamp");
		floorLamp.on();
	}

}
 





당신의 시간이 헛되지 않는 글이 되겠습니다.
I'll write something that won't waste your time.

profile
원하는 것을 창조하고 창조한 것을 의미있게 사용하자

0개의 댓글