Created
June 25, 2019 13:10
-
-
Save khthana/00b308f9c5f0b6b9c71ea51eba315ee9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino_FreeRTOS.h> | |
#define RED 6 | |
#define YELLOW 7 | |
#define BLUE 8 | |
const uint16_t *blueLed = (uint16_t *) BLUE; | |
const uint16_t *redLed = (uint16_t *) RED; | |
const uint16_t *yellowLed = (uint16_t) YELLOW; | |
void setup() { | |
xTaskCreate(LedControllerTask, "RED LED Task", 128, (void *)redLed, 1, NULL); | |
xTaskCreate(LedControllerTask, "BLUE LED Task", 128, (void *)blueLed, 1, NULL); | |
xTaskCreate(LedControllerTask, "YELLOW LED Task", 128, (void *)yellowLed, 1, NULL); | |
} | |
void LedControllerTask(void *pvParameters) | |
{ | |
pinMode(RED, OUTPUT); | |
pinMode(BLUE, OUTPUT); | |
pinMode(YELLOW, OUTPUT); | |
while (1) | |
{ | |
delay(1000); | |
digitalWrite(pvParameters, digitalRead(pvParameters) ^ 1); | |
} | |
} | |
void loop() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment