0% found this document useful (0 votes)
0 views

led + rcc robot code

Uploaded by

akc_its4all
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

led + rcc robot code

Uploaded by

akc_its4all
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Remote control car

int I1 = 4;
int I2 = 5;
int I3 = 6;
int I4 = 7;

void setup()
{

pinMode (I1, OUTPUT);


pinMode (I2, OUTPUT);
pinMode (I3, OUTPUT);

Serial.begin (9600);

void loop()
{
char ann = Serial.read();
if (ann == 'a')
{
digitalWrite (I1 ,LOW);
digitalWrite (I2 ,HIGH);
digitalWrite (I3 ,LOW);
digitalWrite (I4 ,HIGH);

else if (ann == 's')


{
digitalWrite (I1 ,LOW);
digitalWrite (I2 ,LOW);
digitalWrite (I3 ,LOW);
digitalWrite (I4 ,LOW);
}

else if (ann == 'a')


{
digitalWrite (I1 ,LOW);
digitalWrite (I2 ,HIGH);
digitalWrite (I3 ,LOW);
digitalWrite (I4 ,HIGH);

else if (ann == 'w')


Remote control car
{
digitalWrite (I1 ,HIGH);
digitalWrite (I2 ,LOW);
digitalWrite (I3 ,HIGH);
digitalWrite (I4 ,LOW);

Led on and off on=o , off=l

int LED = 12;

void setup()
{
pinMode (LED, OUTPUT);
}

void loop()
{
else if (ann == 'o')
{
digitalWrite (LED, HIGH);
}

else if (ann == 'l')


{
digitalWrite (LED, LOW);
}

You might also like