Skip to content

Instantly share code, notes, and snippets.

View justmangoou's full-sized avatar

Tuan Nguyen justmangoou

  • Vietnam
  • 12:46 (UTC +07:00)
View GitHub Profile
#define TRIG_PIN 12
#define ECHO_PIN 11
#define SAMPLE_INTERVAL_US 30
#define TEMPERATURE 25
#define HUMIDITY 50
static float prv_get_speed_of_sound() {
// Linearized 0% RH: 331.45 + 0.606718 * temperature
const int MAX_PIN = 13;
const int MIN_PIN = 4;
int index = MAX_PIN, currentFill = MIN_PIN;
void setup() {
for (int id = MAX_PIN; id >= MIN_PIN; id--) {
pinMode(id, OUTPUT);
}
}
@justmangoou
justmangoou / co_ban_ve_lap_trinh.md
Last active March 13, 2025 03:31
Cơ bản về lập trình

Cơ bản về lập trình

Đây là những phần lí thuyết mà phải nắm chắc vì là nền tảng cho những phần nâng cao sau này.

Kiểu dữ liệu (Data types)

Trong đa số các ngôn ngữ lập trình đặc biệt là những ngôn ngữ bắt nguồn từ C như C++, Java hay Go đều có nét tương đầu về kiểu dữ liệu.

Trong đó ta chia ra làm 3 phần (Ngôn ngữ C/C++):

Kiểu dữ liệu số

Kiểu dữ liệu số nguyên

Nếu các kiểu chứa unsigned ở đằng trước thì sẽ chỉ có số dương.

import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import xyz.mangostudio.smp.bridge.MinecraftServerBridge;
import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerLoginNetworkHandler;