Healthcare monitoring system based on packet tracer(MPHMS)

Please can someone help me to find this project, or at least gave me some tips how to recreate it? I’m interested In particular, from the built-in insulin level monitoring system.

I have a partially developed code, but I need some help.

This part of the code is for controlling battery levels but does not do the job i need.

var MAX_STORED_POWER = 1500;
var availablePowerPercent = 0;
var availablePower = MAX_STORED_POWER/2;
var LOG_BASE = 1.0749111034571373359815489867558;
var receivedPowerRaw;
var receivedPower=0;
var MULTIPLIER = 255/1023;
function setup() {
	pinMode(1, OUTPUT);
}
function loop(){
	var availablePowerPercent = Math.floor(750*(analogRead(A0) * 100));
	availablePowerPercent = (availablePower/MAX_STORED_POWER) * 100;
	if (availablePowerPercent < 10)
		availablePowerPercent = 10;
	else if (availablePowerPercent < 30)
		availablePowerPercent = 30;
	else if (availablePowerPercent < 50)
		availablePowerPercent = 50;
	else if (availablePowerPercent < 70)
		availablePowerPercent = 70;
	else if (availablePowerPercent < 90)
		availablePowerPercent = 90;
	else if (availablePowerPercent <= 100)
        availablePowerPercent = 100;
	customWrite(0, availablePowerPercent);

This part of the code is for controlling battery levels but does not do the job i need.

What should it do ? What does it do ?

I want to control battery levels sequentially via buttons

"var" ?

GrooveFlotilla: "var" ?

"function" ?

Each packet tracer device (including the battery) has its own code that shows how the device works.
I use the battery code to assemble the code I need.

I also used the code from this project (which works fine) to assemble my code

 var angleRange = {min: 0, max:160};
var signalRange = {min: 1, max: 161};

function setup() {
	pinMode(1, OUTPUT);
}

function loop() {
	var read = Math.floor(255*(analogRead(A0)/1023));
	
	// The value 0 is being used to represent no signal.
	if(read < signalRange.min)
		read = signalRange.min;
	else if(read > signalRange.max)
		read = signalRange.max;		

	// Convert the read value to be angle.	
	read = read * (read - signalRange.min)/(signalRange.max - signalRange.min);
	Serial.println(read);
	customWrite(1, read);
}

Are you sure you've got the right forum?