- #define led 7
- int a = 0;
- void setup() {
- pinMode(led, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- if(Serial.available() != 0){
- a= Serial.read();
- }
- if (a== '0') {
- digitalWrite(ledPin, LOW);
- }
- else if (a== '1') {
- digitalWrite(ledPin, HIGH);
- }
- }
Recent Pastes