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
int pinReed = 2; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
pinMode(pinReed, INPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: |
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 <queue> | |
#include <vector> | |
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
struct circle { | |
int x, y, r; | |
circle() {} |
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
int pinHit = 2; | |
int count = 0; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
pinMode(pinHit, INPUT); | |
attachInterrupt(0, hitISR, FALLING); | |
} |
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
int pinHit = 2; | |
int pinLed = 13; | |
int ledStatus = LOW; | |
int count = 0; | |
volatile int flag = 0; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
pinMode(pinHit, INPUT); |
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 <iostream> | |
#include <vector> | |
using namespace std; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); | |
int n, k; |
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
int d1 = 1, d2 = 2; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
Serial.print(d1); |
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 <LiquidCrystal.h> | |
LiquidCrystal lcd(13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3); | |
int row1Flag = 0; | |
void setup() { | |
// put your setup code here, to run once: | |
lcd.begin(16, 2); | |
lcd.print("Hello!!"); |
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 <queue> | |
#include <vector> | |
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
vector<int> tree[50]; | |
int dist[50]; |
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
/* | |
* Example to demonstrate thread definition, semaphores, and thread sleep. | |
*/ | |
#include <FreeRTOS_AVR.h> | |
// The LED is attached to pin 13 on Arduino. | |
const uint8_t LED_PIN = 13; | |
// Declare a semaphore handle. | |
SemaphoreHandle_t sem; |
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 <queue> | |
#include <vector> | |
#include <string> | |
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
#define max(n, m) n > m ? n : m |