User interface will be redesigned.
New commands will be added:
BATTERY_LEVEL ()
returns current battery charge level, from 0 to 100 percent.
BATTERY_STATE ()
returns current battery charging state: 0 is discharging, 1 is charging.
2.9 version
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.9 version
How precise is the battery level?
If you keep a program running...
What is the difference in power?
How much time was involved?
How long did the power remain stable?
Can you make the power remain stable at the same frequency as the time involved over the difference in power use?
If you keep a program running...
What is the difference in power?
How much time was involved?
How long did the power remain stable?
Can you make the power remain stable at the same frequency as the time involved over the difference in power use?
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: 2.9 version
Battery_level() returns a integer percentage. That makes it rather useless for analysis of current usage.
-
- Posts: 3
- Joined: Sat Jun 09, 2018 11:24 am
- My devices: iPhone SE King size
- Flag:
Re: 2.9 version
That and I don’t see any way to turn on and off the battery usage (more/less)...
I could see how this could be a problem as
I think we should establish a code for the most power and least differentiation sir.
I could see how this could be a problem as
I think we should establish a code for the most power and least differentiation sir.
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: 2.9 version
Not sure what you mean, but you can indeed save power by the SB statement SLOWDOWN. It puts the processor on a lower capacity somehow.
It's usefull in program segments where an input from the user is required, for instance something like:
............
do slowdown
until button_pressed ("ok_button")
............
It's usefull in program segments where an input from the user is required, for instance something like:
............
do slowdown
until button_pressed ("ok_button")
............
-
- Posts: 9
- Joined: Tue Jul 17, 2018 11:06 pm
- My devices: iPhone SE, Full Service JVC, Sony Audio
Re: 2.9 version
I’d like the code to that slowdown command. Kinda a mediator from itself on of the power levels, I’d keep that in check too.
Come to think of it, with BATTERY_LEVEL() is the difference still accounted for?
Come to think of it, with BATTERY_LEVEL() is the difference still accounted for?
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: 2.9 version
(Again) not sure what is meant here.Oliver Haken wrote: ↑Thu Jul 19, 2018 12:08 amI’d like the code to that slowdown command. Kinda a mediator from itself on of the power levels, I’d keep that in check too.
Come to think of it, with BATTERY_LEVEL() is the difference still accounted for?
Anyway, with the following program one may test the depletion rate of the device battery under different conditions.
The program works as follows:
First, the program waits until a batery-level jump down of one percent.
Then the timer is started and the time is measured until the next one percent down jump of the battery_level, using a do loop in which executing code may be placed.
The 1% decrease is then extrapolated to a 90% level decrease and printed in hours.
Code: Select all
def bl() = battery_level()
print "Waiting for a change in battery level ...."
old_level=bl() ! do until bl()<old_level
print ! print "measuring ......." ! print
old_level = bl()
time reset ! set brightness 0
do
slowdown /* activate to measure influence of slowdown */
'
' sB code to be metered on usage of current
'
' wifi, 4G, GPS, BT, etc. chips activated or not
'
until bl() < old_level
t=int(time()/4)/10 ! set brightness 1
print "time to depleat a full battery to 10% ";t;" hours"
end
a. No specific action : 4.6 hours
b. Screen off and Flight mode on (-> all radio chips off) : 5.6 hours
c. b. and slowdown command (see listing) : 15.3 hours
Hence the effect of the slowdown command is huge.
-
- Posts: 9
- Joined: Tue Jul 17, 2018 11:06 pm
- My devices: iPhone SE, Full Service JVC, Sony Audio
Re: 2.9 version
STRSHIFTLEFT (string$, num)
Does this mean anything to being able to more closely track the decimal placement?!
I’m not sure how it would be used seen as it’s a string$ type, not a integer or float type variable.
I’m assumputuous to the nature of it being the same as #SET in application, which also functions numeric limitations, but in terms of memory management instead of processing.
I found:
COMMAND (<byRef | byval> arg1 <AS type>,..)
But I have no guesses on how the argument is passed.
This leads me in a loop where I am trying to see unrelated COMMANDS as arguments of LOOPS through #SET 1,1 and #SET 2,0 notation, while trying to tag <AS type> to the same reference as far as this program goes...
In terms of my main project here it’s good to state ByVal was the connection leading to functionality.
But how to reference the arguments, and even in this way, i cannot seem to grasp, no I can not help with this double energy project.
Does this mean anything to being able to more closely track the decimal placement?!
I’m not sure how it would be used seen as it’s a string$ type, not a integer or float type variable.
I’m assumputuous to the nature of it being the same as #SET in application, which also functions numeric limitations, but in terms of memory management instead of processing.
I found:
COMMAND (<byRef | byval> arg1 <AS type>,..)
But I have no guesses on how the argument is passed.
This leads me in a loop where I am trying to see unrelated COMMANDS as arguments of LOOPS through #SET 1,1 and #SET 2,0 notation, while trying to tag <AS type> to the same reference as far as this program goes...
In terms of my main project here it’s good to state ByVal was the connection leading to functionality.
But how to reference the arguments, and even in this way, i cannot seem to grasp, no I can not help with this double energy project.
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: 2.9 version
I guess the foregoing post is meant for another forum.
-
- Posts: 9
- Joined: Tue Jul 17, 2018 11:06 pm
- My devices: iPhone SE, Full Service JVC, Sony Audio
Re: 2.9 version
Oliver Haken wrote: ↑Tue Jul 24, 2018 7:12 am
This is what I’m into regarding smart basic... I figured it fit at battery level integration, kinda spammed it but it reads timely.