0% found this document useful (0 votes)
9 views3 pages

LAB1 Led

Uploaded by

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

LAB1 Led

Uploaded by

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

const int LEDPIN = 23;

const int PushButton =22;


void setup()
{
pinMode(LEDPIN, OUTPUT);
pinMode(PushButton, INPUT);
}
void loop()
{
int Push_button_state = digitalRead(PushButton);
if ( Push_button_state == HIGH )
{
digitalWrite(LEDPIN, HIGH);
}
else
{
digitalWrite(LEDPIN, LOW);
}
}

https://wokwi.com/projects/366077828149504001
void Taskl1( void *pvParameters);
void Taskl2( void *pvParameters);
void setup()
{
Serial.begin(9600);
while (!Serial)
{
;
}
xTaskCreate(Taskl1 , "Blink" , 1024 ,
NULL , 2 , NULL);
xTaskCreate(Taskl2 , "Blink" , 1024 ,
NULL , 1 , NULL);
}
void loop()
{}
void Taskl1(void *pvParameters)
{
(void) pvParameters;
pinMode(15, OUTPUT);
for (;;)
{
digitalWrite(15, HIGH);
vTaskDelay(400);
digitalWrite(15, LOW);
vTaskDelay(400);
}
}
void Taskl2(void *pvParameters)
{
(void) pvParameters;
pinMode(4, OUTPUT);
for (;;)
{
digitalWrite(4, HIGH);
vTaskDelay(600);
digitalWrite(4, LOW);
vTaskDelay(600);
}
}

https://wokwi.com/projects/366078473396020225
https://wokwi.com/projects/366229490802811905

You might also like