May 10, 2015 at 18:38 #5382
I have to get the battery level of lego mindstorms EV3, and I do not
know how. I used the MonobrickFirmware library. (I code in VB.net)
In my program, I have used this for the show but it got me really big
numbers with powers.
Here is my code:
Label4.Text = MonoBrickFirmware.Management.Battery.Current.Epsilon
Can you tell me how to do, to recover the battery?
This is very urgent!
Thank you to answer me as quickly as possible and thank you in
May 11, 2015 at 11:03 #5384
- This topic was modified 6 years, 4 months ago by Auriacombe Guillaume.
Try to look here. You just need to call the Current or voltage without the Max (this is MaXValue of an float).
/AndersMay 12, 2015 at 18:59 #5385
I did as you told me, but it puts a lot and put it in Volt I do not know how in visual basic .net ? :/
An idea ?
I put the number that appears as an attachment.
If you could tell me the voltage or the battery level, because I did not understand what it was for is what is the level of battery or tension?
And, the code I do not know what to put.
Thank you for helping me.
It’s very urgent, and it’s important !
- This reply was modified 6 years, 4 months ago by Auriacombe Guillaume.
Attachments:You must be logged in to view attached files.May 13, 2015 at 12:56 #5389
I understand that you are getting the wrong number. Please post your code code instead of a screenshot.
/AndersMay 14, 2015 at 18:39 #5390
This my code :
This is my code, (Button Connect)
` Private Async Sub Connect_Click(sender As Object, e As EventArgs) Handles Connect.Click
‘ Connexion bluetooth
‘_brick = New Brick(New BluetoothCommunication(textBox1.Text))
‘Connexion wifi, on récupère l’adresse IP de la brick
_brick = New Brick(New NetworkCommunication(textBox1.Text))
‘_brick = New Brick(New UsbCommunication())
‘Vérifie quel langues a été choisi et met le bon texte
If ComboBox1.SelectedIndex = 0 Then
Status.Text = “Connexion en cours …”
ElseIf ComboBox1.SelectedIndex = 1 Then
Status.Text = “Connecting …”
ConnectionFaite = True
Me.Enabled = False
‘Il se connecte sans erreur
Catch ex As NullReferenceException
‘Si connexion Impossible, alors affiché une erreure, dans une boîte de dialogue
Catch ex As Exception
ConnectionFaite = False
Me.Enabled = True
If ConnectionFaite Then
‘Await _brick.DirectCommand.PlayToneAsync(100, 1000, 300)
FirmwareVersion.Text = Await _brick.DirectCommand.GetFirmwareVersionAsync()
HERE IS VERY IMPORTANT !!
nivBattery.Text = Battery.Current.MaxValue
Thank you in adavance ! 🙂
GuillaumeMay 18, 2015 at 19:23 #5395
As I tried to say in an earlier post you need to write
nivBattery.Text = Battery.Current
/AndersMay 20, 2015 at 15:45 #5401
I’m sorry, but it’s impossible that “nivBattery.Text = Battery.Current”, because it does not work.
Help me, please.
GuillaumeMay 25, 2015 at 14:21 #5404
You are mixing code from the communication library and the Monobrick firmware… please create a simple console application – if in fact you are trying to use the firmware.
You must be logged in to reply to this topic.