Page 1 of 1

2.9 version

Posted: Wed Nov 06, 2013 4:52 pm
by Mr. Kibernetik
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.

Re: 2.9 version

Posted: Mon Jun 04, 2018 3:00 am
by Ollie
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?

Re: 2.9 version

Posted: Mon Jun 04, 2018 6:46 am
by Henko
Battery_level() returns a integer percentage. That makes it rather useless for analysis of current usage.

Re: 2.9 version

Posted: Sat Jun 09, 2018 11:31 am
by Lt. Mitchell
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.

Re: 2.9 version

Posted: Sat Jun 09, 2018 3:33 pm
by Henko
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")
............

Re: 2.9 version

Posted: Thu Jul 19, 2018 12:08 am
by Oliver Haken
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?

Re: 2.9 version

Posted: Thu Jul 19, 2018 9:42 am
by Henko
Oliver Haken wrote:
Thu Jul 19, 2018 12:08 am
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?
(Again) not sure what is meant here.

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
I tested 3 situations with the following results:

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.

Re: 2.9 version

Posted: Thu Jul 19, 2018 4:59 pm
by Oliver Haken
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.

Re: 2.9 version

Posted: Thu Jul 19, 2018 6:53 pm
by Henko
I guess the foregoing post is meant for another forum.

Re: 2.9 version

Posted: Tue Jul 24, 2018 8:22 am
by Oliver Haken
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.