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.
main.cpp
- Committer:
- turko
- Date:
- 2020-11-18
- Revision:
- 0:230ae3fb93aa
File content as of revision 0:230ae3fb93aa:
#include "mbed.h"
DigitalOut myLED1(A1);
DigitalOut myLED2(A2);
DigitalOut myLED3(A3);
DigitalOut myLED4(A4); 
AnalogIn analog_value(A0);
float r;
int main() {
    
    
    
    while(1){
    r=100*analog_value.read();
        if (r>0){
            
            myLED1 = 1;
            if (r>25){
            
                myLED2 = 1;
                if (r>50){
            
                    myLED3 = 1;
                    if (r>0){
            
                        myLED4 = 1;
                    
                    }
                
                }
            
            }
        
        }
        
        
    }
}