Discuss Scratch
- nikhilscratch2008
-
37 posts
Battery detector
i think a battery detector could be a good block for scratch. Lets say we are making an os on scratch. the battery block could be used to determine if the user has to plug in their device.
any feedback? thanks
any feedback? thanks
Last edited by nikhilscratch2008 (Jan. 14, 2021 20:52:23)
- portalpower
-
1000+ posts
Battery detector
when green flag clicked
if <(battery::sensing) = [haha funny number]> then
broadcast [start v]
else
say [>:(]
stop [all v]
end
- nikhilscratch2008
-
37 posts
Battery detector
the code you wrote above could be an example of how the battery block is used
- dertermenter
-
1000+ posts
Battery detector
Sorry, cool idea but don't think it will be used. its ok if you do not support the idea
Pro tip: Use the ‘quotes’ when replying to someone!
- JackK211424
-
500+ posts
Battery detector
according to this battery detection isn't really an internet standard to have and therefore some browsers may not support it.
it is shown with this image that some odd 20% of the most common browsers dont support it. And the browsers that do have limited support (due to security n stuffs)

it is shown with this image that some odd 20% of the most common browsers dont support it. And the browsers that do have limited support (due to security n stuffs)

Last edited by JackK211424 (Jan. 14, 2021 21:54:21)
- ShyGamer16
-
500+ posts
Battery detector
Same. I can't think of a valid use for battery detection
- thisaccountisameme
-
100+ posts
Battery detector
Ok- let me say how this could potentially be good.
So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.
So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.
Last edited by thisaccountisameme (Jan. 14, 2021 23:15:03)
- dertermenter
-
1000+ posts
Battery detector
Ok- let me say how this could potentially be good.
So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.
That is a good post. I agree, that, Although it could be useful, it is not worth it, and Some major platforms Don’t even have battery detection yet, meaning this block won’t even work, right?
- JackK211424
-
500+ posts
Battery detector
two out of five of the most common browsers dont support this, and It also may be removed from more.Ok- let me say how this could potentially be good.
So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.
That is a good post. I agree, that, Although it could be useful, it is not worth it, and Some major platforms Don’t even have battery detection yet, meaning this block won’t even work, right?
Though, it could be implemented into scratch link.
Last edited by JackK211424 (Jan. 15, 2021 13:55:44)
- nikhilscratch2008
-
37 posts
Battery detector
agreed that the fetch battery support might drop and the block will be useless over time. Great opinions guys
- IndianRuby718
-
100+ posts
Battery detector
(battery level :: sensing)I think this is a cool idea, and I can see this being used for OS's, but as some major browsers don't support it, it probably wouldn't work… If not for this I'd support it..
This suggestion also made me think of this:
<device charging? :: sensing>This would be pretty cool too in mostly the same way as a battery detector, and they would go together. I would support both of these, but neither of them are recommended or entirely supported, and could be removed from support at any time..
- NotDucki_
-
1000+ posts
Battery detector
This can be easily replicated with variables, however.
heres the conditions for it to show
In the battery icon
if <(batterylevel) < [25]> thenthen for plugging it in, there would be a button that says: Charge
broadcast [showchargedevice v]//Then, in the sprite named "AlertBattery" it would say "You might want to charge your device"
end
heres the conditions for it to show
In the battery icon
when this sprite clickedfor the “Charge” button
broadcast [check v]
when I receive [check v]Battery Script:
if <(batterylevel) < [25]> then
broadcast [charge v]
end
repeat until <(batterylevel) < [25]>and
wait (10) secs
change [batterylevel v] by (-1)
end
when I receive [charge v]
repeat until <(batterylevel) = [100]>
wait (10) secs
change [batterylevel v] by (1)
Last edited by NotDucki_ (Jan. 21, 2021 00:50:06)
- IndianRuby718
-
100+ posts
Battery detector
This suggestion is for detecting the device's actual battery level, not as a simulator This can be easily replicated with variables, however.:P-snip- :: sensing
- the2000
-
1000+ posts
Battery detector
No support just because I see no practical use for it (no one actually uses Scratch OSes, so I see no real reason to give them battery displays). Also yeah, compatibility and stuff.
- JackK211424
-
500+ posts
Battery detector
The only way I could see this working would be connecting the battery level blocks to scratch link, that way compatibility issues are solved (mostly) and some browser blocking issues.
I dont think its worth implementing, though.
Oh also here is the compatibility chart, Not sure why I didnt post it before
Nevermind I did post it?
Im tired and confused lol
I dont think its worth implementing, though.
Oh also here is the compatibility chart, Not sure why I didnt post it before
Nevermind I did post it?
Im tired and confused lol
Last edited by JackK211424 (Jan. 21, 2021 02:21:36)
- NotDucki_
-
1000+ posts
Battery detector
This suggestion is for detecting the device's actual battery level, not as a simulator This can be easily replicated with variables, however.:P-snip- :: sensing
It states not about real devices, it just says device. i think a battery detector could be a good block for scratch. Lets say we are making an os on scratch. the battery block could be used to determine if the user has to plug in their device.
any feedback? thanks