- Huawei P20 - ez is kétkezes lett
- Yettel topik
- Google Pixel 10 Pro XL – tíz kicsi Pixel
- Huawei Watch GT 6 és GT 6 Pro duplateszt
- Milyen robotporszívót vegyek karácsonyra? (2025)
- iPhone topik
- Szívós, szép és kitartó az új OnePlus óra
- VoLTE/VoWiFi
- Hat év támogatást csomagolt fém házba a OnePlus Nord 4
- One mobilszolgáltatások
-
Mobilarena
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Janos250
őstag
válasz
Tomika86
#16165
üzenetére
Az egyik felét hagyod a loopban, az fut majd az 1-es magon.
Csinálsz egy függvényt, abba teszed a másik felét, és az megy ./*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
*********/
TaskHandle_t Task1;
//TaskHandle_t Task2;
// LED pins
//const int led1 = 2;
//const int led2 = 4;
void setup() {
Serial.begin(115200);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
//create a task that will be executed in the Task1code() function, with priority 1 and executed on core 0
xTaskCreatePinnedToCore(
Task1code, /* Task function. */
"Task1", /* name of task. */
10000, /* Stack size of task */
NULL, /* parameter of the task */
1, /* priority of the task */
&Task1, /* Task handle to keep track of created task */
0); /* pin task to core 0 */
delay(500);
/*
//create a task that will be executed in the Task2code() function, with priority 1 and executed on core 1
xTaskCreatePinnedToCore(
Task2code,
"Task2",
10000,
NULL,
1,
&Task2,
1);
Ez nem kell, mert a loop automatikusan a 0. magra megy.
*/
delay(500);
}
//Task1code: blinks an LED every 1000 ms
void Task1code( void * pvParameters ){
Serial.print("Task1 running on core ");
Serial.println(xPortGetCoreID());
/*
for(;;){
digitalWrite(led1, HIGH);
delay(1000);
digitalWrite(led1, LOW);
delay(1000);
*/
// ide jön a 0-án futtatandó programrész
Serial.print("Task1 running on core ");
Serial.println(xPortGetCoreID());
}
}
/*
//Task2code: blinks an LED every 700 ms
void Task2code( void * pvParameters ){
Serial.print("Task2 running on core ");
Serial.println(xPortGetCoreID());
for(;;){
digitalWrite(led2, HIGH);
delay(700);
digitalWrite(led2, LOW);
delay(700);
Serial.print("Task2 running on core ");
Serial.println(xPortGetCoreID());
*/
}
}
void loop() {
// ide jön, ami az 1-es magon fusson
}
Új hozzászólás Aktív témák
- Lenovo ThinkPad X13 G2 13.3" -50% AMD Ryzen 5 Pro 5650U Hexa-core 16GB 512GB SSD FHD
- Gaming PC - R5 9600X,RTX 5070 12GB,32GB DDR5,1TB NVMe,850W
- Ultra PC - R7 7800X3D,RTX 5080 16GB,32GB DDR5,1TB NVMe,1200W
- Uhh Lenovo ThinkPad P15 G2 Tervező Vágó Laptop -75% 15,6" i5-11500H 32/1TB RTX A2000 4GB /1 Millió/
- Lenovo Legion 5 15ARH05H - Gamer Laptop
- Endgame Gear gamer egerek /OP1 8K, XM2we, XM1R, XM1 RGB (fehér/fekete/lila)/
- RAPOO 7100P 1000DPI optikai rádiós 5GHz egér
- BESZÁMÍTÁS! ASRock Z390 i5 8600K 16GB DDR4 512GB SSD RX 6500 XT 8GB Bitfenix Neos acél DeepCool 450W
- Gamer/streamer mikrofon, állvány és USB HUB kitűnő árakon!
- Spirit of GAMER!! Lègy a játèkok URA
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi
ekkold

