Introduction: Using Button to ON & OFF Led With CloudX M633

<img src =""/>

Did you know that you can use CloudX M633 to turn on an LED when you press a button?

In this project am going to show you how you can use button to ON and OFF Led. when you press the button the led will on, when you press it again the led will off.

Step 1: Component

Get all this component if you want to start;

  • CloudX M633>

  • CloudX SoftCard
  • V3 Cable
  • Led
  • Button Switch
  • Jumper Wire
  • 10k resistor
  • Breadboard

You can get your component Here


Step 3: CODING

Copy this Code to your CloudX M633

#include <CloudX/M633.h>
#define BULB pin1
#define Button pin2
bit flag;
           //setup here
         pinMode(1, OUTPUT);
         pinMode(2, INPUT);
         BULB = LOW;
           //Program here
    if(Button == 0 && BULB == LOW){
    BULB = HIGH;         // turn on digital pin 1
    if(Button == 0 && BULB == HIGH ){
    BULB = LOW;          // turn off digital pin 1