Receive the data between 0 to 9 serially using arduino.

Here i am using online IDE Tinkercad . If you don't know what is tinkercad then refer my blog HERE or else you can use offline IDE also.

Code :-

void setup()

{

  Serial.begin(9600);

}

int i =0;

void loop()

{

  if(Serial.available()){

  i =Serial.read();

  delay(600);

  Serial.print("Number is : ");

    Serial.write(i);

  Serial.print("\n");}

}

Output :-



Comments

Popular Posts

What is Tinkercad ? How to use Tinkercad ?

Connect switch to Arduino. If switch is on than print ”ON” else print “OFF” on serial monitor.

Set the time using four switch and display the clock on LCD using arduino ** SW1 : when press, increment 1 digit ** SW2 : when press, decrement 1 digit ** SW3 : when press, display set time and start the clock ** SW4 : when press, reset the clock