3.1.4 Codes

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Flashlight Responding to Light Code

while(1 ==1) { if(SensorValue(lightSensor)>700) { turnFlashlightOn(flashlight,127); } if(SensorValue(lightSensor)<=700) { turnFlashlightOff(flashlight); } }

Flashlight Responding to Light and a Switch Code

while (condition)//repeat indefinitely { while (condition)//repeat while limitSwitch pressed { if (condition)//respond to lightSensor { } else { } } //do this when the limitSwitch is not pressed }

Blinking LED with Switch Code

ClearTimer(T1); while(time1(T1) < 20000) //Loop for 20 sec { turnLEDOn(green); wait(2); turnLEDOff(green); wait(2); }


Set pelajaran terkait

Marketing exam three 9-10, 12-13

View Set

Chapter 42: Assessment and Concepts of Care for Patients with Eye and Vision Problems

View Set

Introductory Biology II Exam 2 - CH 24 Protists

View Set

anatomy and physiology 2 quiz one

View Set

Chapter 8 TCP/IP Internetworking I

View Set

Lecture 26- Diffusion and Osmosis

View Set

Psych 101 Exam 3 - Social Psychology

View Set