Skip to content

Instantly share code, notes, and snippets.

int hpa_to_scale(float hpa_value) {
// Define the range of HPA values that will correspond to the 1-10 scale
float min_hpa = 950.0;
float max_hpa = 1030.0;
// Normalize the HPA value to fall within the defined range
float normalized_hpa = fmax(fmin(hpa_value, max_hpa), min_hpa);
// Scale the normalized HPA value to the 1-10 range
int scale_value = round((normalized_hpa - min_hpa) * 10.0 / (max_hpa - min_hpa) + 1.0);
@fokklz
fokklz / wall.lua
Created July 11, 2021 12:52
wall programm for mining turtle
local width = 0
local height = 0
local locX = 1;
local locZ = 1;
local locY = 0;
local removedTop = false;
if #arg == 2 then