Skip to content

Instantly share code, notes, and snippets.

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:
#include <queue>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
struct circle {
int x, y, r;
circle() {}
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);
}
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);
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
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);
#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!!");
#include <queue>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
vector<int> tree[50];
int dist[50];
/*
* 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;
#include <queue>
#include <vector>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
#define max(n, m) n > m ? n : m