Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Opticki_senzor_long_code.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled1 (LED1); 00004 DigitalOut myled2 (LED2); 00005 DigitalIn switchInput1 (p5); 00006 DigitalIn switchInput2 (p15); 00007 00008 int main() { 00009 00010 int switchState1, switchState2; 00011 00012 while(true){ 00013 00014 //lamapice se pale kada se prekine dovod svjetla na senzore 00015 switchState1 = switchInput1.read(); 00016 switchState2 = switchInput2.read(); 00017 00018 if(switchState1 == 1) myled1 = 0; 00019 else myled1 = 1; 00020 00021 if(switchState2 == 1) myled2 = 1; 00022 else myled2 = 0; 00023 00024 } 00025 00026 }
Generated on Sat Aug 20 2022 06:22:08 by
1.7.2