-
Fototrend
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
- AKCIÓ!!! DDR5 GAMER PC: Intel Core Ultra 7 265KF +RX 9070/9070 XT +16-64GB DDR5! GAR/SZÁMLA!
- AKCIÓ! GAMER PC: i5-14400F (10mag/16szál) +RTX 5050/5060/5060Ti/5070/5080 +16-64GB DDR4! GAR/SZÁMLA!
- iPhone 13 Pro 126GB Gold Független 89% Gyári Akku iOS 17.3.
- Dell OptiPlex 7050 Micro i5-7500 / 8GB RAM / 256GB M.2 SSD
- Kompakt Gamer PC - i5-4750 + R9 380 4GB + 8 GB RAM
- BESZÁMÍTÁS! Apple MacBook Air 15 M4 24GB RAM 1TB SSD macbook garanciával hibátlan működéssel
- HIBÁTLAN Apple Watch Ultra 2 Natural Titanium 49mm -1 ÉV GARANCIA - 100% Akkumulátor, MS3220
- Samsung Galaxy A21s 32GB, Kártyafüggetlen, 1 Év Garanciával
- Lenovo ThinkPad X13 G2 multitouch (minimálisan használt)
- GYÖNYÖRŰ iPhone 13 mini 256GB Red -1 ÉV GARANCIA - Kártyafüggetlen, MS3405
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő