From d062de2eb8d5cc4f73b7861f0a312feebcb77d4f Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 24 Nov 2022 20:24:15 +0100 Subject: [PATCH] better pseudo random --- EXRAIL2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index d4961c7..96cb447 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -727,7 +727,7 @@ void RMFT2::loop2() { break; case OPCODE_IFRANDOM: // do block on random percentage - skipIf=(int16_t)(micros()%100) >= operand; + skipIf=(uint8_t)micros() >= operand * 255/100; break; case OPCODE_IFRESERVE: // do block if we successfully RERSERVE