From 656422174603817b28500afb569effc9932a8f86 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 26 Feb 2023 18:05:50 -0500 Subject: [PATCH] added rnd_float --- cubesatsim/cubesatsim.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 24146f8a..d7fc83ac 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -80,6 +80,10 @@ char call[] = "AMSAT"; // put your callsign here extern bool get_camera_image(bool debug); extern bool start_camera(); +float rnd_float(float upper, float lower) { + return (float)(random(upper*100, lower*100)/100.0); +} + void setup() { set_sys_clock_khz(133000, true);