Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show supply voltage for battery operation #3

Open
StefanTrethan opened this issue Jun 6, 2018 · 4 comments
Open

Show supply voltage for battery operation #3

StefanTrethan opened this issue Jun 6, 2018 · 4 comments

Comments

@StefanTrethan
Copy link

It would be nice for battery operation if the supply voltage could optionally be shown on the display.
Ideally there would also be an adjustable low voltage warning or shutdown via the menu.

@PTDreamer
Copy link
Owner

Hi, thank you for opening this issue.

The main problem I have to continue to develop this firmware is that both my stations (JBC and Hakko) are being used daily and inside a case.
I have sent a message to kseger oficial seller on aliexpress to see if they are willing to donate a new controller.
If anyone is willing to develop this I can give a few pointers or even write some snippets.

@StefanTrethan
Copy link
Author

StefanTrethan commented Jun 8, 2018 via email

@StefanTrethan
Copy link
Author

So I managed to add the voltage readout (I put it between the tip number and ambient temperature).
I had to correct the scaling from 3300 to 2833 but now it is perfect.

I'm not sure if I should mess with a low battery warning, or with adding menu functions.
It feels like I am way out of my depth and I should be very glad I got this far without blowing up your code. You see I am the kind of "programmer" that gets extremely uneasy at the use of pointers.

For now, I think this is good enough, but maybe I will feel like breaking it some more later.
I even found your switches for JBC and the large display, I am very proud of that.

Thanks again for providing this very useful software to us!

Stefan

This is what I added to main_screen.c:
(Let me know if I should send you the file)

static void * main_screen_getSupplyVoltage_mv() { // STR
temp = getSupplyVoltage_mv() / 10;
return &temp;
}

//Supply voltage display // STR
widget = screen_addWidget(scr);
widgetDefaultsInit(widget, widget_display);
widget->posX = 35;
widget->posY = 50;
widget->font_size = &FONT_8X14;
widget->displayWidget.getData = &main_screen_getSupplyVoltage_mv;
widget->displayWidget.number_of_dec = 1;
widget->displayWidget.type = field_uinteger16;
widget->reservedChars = 4;


//Supply voltage V symbol // STR
widget = screen_addWidget(scr);
widgetDefaultsInit(widget, widget_label);
char *v = "V";
strcpy(widget->displayString, v);
widget->posX = 67;
widget->posY = 50;
widget->font_size = &FONT_8X14;
widget->reservedChars = 1;
widget->draw = &default_widgetDraw;

@PTDreamer
Copy link
Owner

Hi,

Congrats on the new feature coding!
Ideally you would send a pull request for this. You can use a gui like GitKraken if you are not comfortable with git. I can guide trough it if you want, and also help you with other features you want to add.
That is if you are interested in learning this things, if not I can just copy the code above and add it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants