-
PROHARDVER!
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
- Corsair SF850L Gold 850W SFX Moduláris Tápegység
- Corsair RM1000X Gold 1000W Moduláris Tápegység PCIE 5 ATX 3 12VHPWR
- Lenovo ThinkPad P15 Tervező Vágó Laptop -50% 15,6" i7-10750H 16/512 QUADRO T1000 4GB
- MAKULÁTLAN! Dell Precision 7760 Tervező Vágó Laptop -70% 17,3" i7-11850H 32/1TB NVIDIA A3000 6GB FHD
- Kiwiears Astral
- AKCIÓ! HP Victus Gaming 16-S0017NH 16 notebook - R5 7640HS 32GB DDR5 1TB SSD RTX 4050 6GB WIN1
- JBL Xtreme 4 új, bontatlan akciós áron eladó!
- Bomba ár! Fujitsu T936 Convertible: i5-6G I 8GB I 256SSD I 13,3" FHD Touch I Cam I W10 I Gari!
- HIBÁTLAN iPhone 13 Pro 128GB Sierra Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3667 100% Akkumulátor
- GYÖNYÖRŰ iPhone 12 mini 128GB Green -1 ÉV GARANCIA - Kártyafüggetlen, MS3395, 94% Akkumulátor
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest