Click here to Skip to main content
15,876,991 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: GPT4 is far too diplomatic Pin
Al Fargnoli21-Jun-23 9:07
Al Fargnoli21-Jun-23 9:07 
GeneralRe: GPT4 is far too diplomatic Pin
MarkTJohnson22-Jun-23 1:41
professionalMarkTJohnson22-Jun-23 1:41 
GeneralRe: GPT4 is far too diplomatic Pin
Ryan Peden20-Jun-23 7:55
professionalRyan Peden20-Jun-23 7:55 
GeneralRe: GPT4 is far too diplomatic Pin
obermd20-Jun-23 11:12
obermd20-Jun-23 11:12 
GeneralRe: GPT4 is far too diplomatic Pin
11917640 Member 20-Jun-23 18:44
11917640 Member 20-Jun-23 18:44 
GeneralRe: GPT4 is far too diplomatic Pin
GKP199220-Jun-23 22:35
professionalGKP199220-Jun-23 22:35 
GeneralRe: GPT4 is far too diplomatic Pin
11917640 Member 22-Jun-23 0:37
11917640 Member 22-Jun-23 0:37 
GeneralI can't tell if I'm having fun or not. PinPopular
honey the codewitch20-Jun-23 3:29
mvahoney the codewitch20-Jun-23 3:29 
Working on code to monitor various statistics on my PC from little IoT devices.

The PC companion app draws from all the sensors your hardware provides, such as cpu and gpu frequencies and temperatures or usage. These are just examples. There are a lot more.

Since there are so many, and the screens are small, I'm setting it up so you can drive multiple IoT devices from one companion app and have each screen display its own information (selectable by you).

Each screen can potentially display more than one sensor value. How many depends on the size of the display. The display scales, with clamping so it doesn't get too big or too small, and is completely elastic, resizing the display as necessary and rebuilding the display if new sensors are to be monitored or current sensors removed from the screen.

Here's what a packet looks like - sent over serial UART ten times a second:

C++
typedef struct screen_packet {
    // the command id
    constexpr static const int command = 1;
    char format[16];
    float value_max;
    uint8_t icon[16*16*2];
    uint32_t color1;
    uint32_t color2;
    bool hsv_color;
    float value;
} screen_packet_t;


Basically a packet represents one sensor value. It has an associated icon, C format string (used by sprintf()), the max value, and color information (potentially for drawing gradients) plus the actual value itself.

This is enough to render one piece of monitor information. The serial sends a command id (always 1) followed by a count of packets, followed by the packets above. If the number of packets, and the first couple fields of each packet do not change, the screen is updated rather than rebuilt. Otherwise the entire screen is rebuilt (.NET devs think like controls are cleared and then InitializeComponent() is called again and the appropriate controls are recreated and added to the screen.

The other thing that's tricky is displaying the usage history plus current bar representing the current value (relative to the specified max value) - I've combined them so they overlay each other to save space, but drawing it is tricky, involving among other things, drawing a polygon filled with a gradient to represent the history graph. It also has to work on monochrome.

The firmware code so far is simpler than I expected it to be, considering, but I have yet to write the PC app* to test it with.

*I have a previous PC monitor PC companion app I wrote that I intend to modify but it's a lot of work because nearly everything has changed.

This requires a lot of creative problem solving but also a lot of fiddling as well as a lot of boilerplate garbage that I hate writing, particularly on the .NET side. That part is boring.
Check out my IoT graphics library here:
https://honeythecodewitch/gfx


modified 20-Jun-23 9:41am.

GeneralRe: I can't tell if I'm having fun or not. Pin
Mike Hankey20-Jun-23 3:38
mveMike Hankey20-Jun-23 3:38 
GeneralRe: I can't tell if I'm having fun or not. Pin
honey the codewitch20-Jun-23 3:38
mvahoney the codewitch20-Jun-23 3:38 
GeneralRe: I can't tell if I'm having fun or not. Pin
Mike Hankey20-Jun-23 3:52
mveMike Hankey20-Jun-23 3:52 
GeneralRe: I can't tell if I'm having fun or not. Pin
Gary R. Wheeler20-Jun-23 14:52
Gary R. Wheeler20-Jun-23 14:52 
GeneralRe: I can't tell if I'm having fun or not. Pin
Mike Hankey20-Jun-23 15:59
mveMike Hankey20-Jun-23 15:59 
GeneralRe: I can't tell if I'm having fun or not. Pin
Gary R. Wheeler22-Jun-23 14:44
Gary R. Wheeler22-Jun-23 14:44 
GeneralRe: I can't tell if I'm having fun or not. Pin
Mike Hankey22-Jun-23 16:22
mveMike Hankey22-Jun-23 16:22 
GeneralRe: I can't tell if I'm having fun or not. Pin
BillWoodruff20-Jun-23 19:59
professionalBillWoodruff20-Jun-23 19:59 
GeneralRe: I can't tell if I'm having fun or not. Pin
honey the codewitch21-Jun-23 2:45
mvahoney the codewitch21-Jun-23 2:45 
GeneralRe: I can't tell if I'm having fun or not. Pin
jschell21-Jun-23 5:56
jschell21-Jun-23 5:56 
GeneralRe: I can't tell if I'm having fun or not. Pin
honey the codewitch21-Jun-23 6:45
mvahoney the codewitch21-Jun-23 6:45 
GeneralRe: I can't tell if I'm having fun or not. Pin
jschell22-Jun-23 7:36
jschell22-Jun-23 7:36 
GeneralRe: I can't tell if I'm having fun or not. Pin
honey the codewitch22-Jun-23 8:22
mvahoney the codewitch22-Jun-23 8:22 
Generalc# deskew image Pin
fulvio.fabiani20-Jun-23 2:54
fulvio.fabiani20-Jun-23 2:54 
GeneralRe: c# deskew image Pin
OriginalGriff20-Jun-23 2:57
mveOriginalGriff20-Jun-23 2:57 
GeneralRe: c# deskew image Pin
Mike Hankey20-Jun-23 3:03
mveMike Hankey20-Jun-23 3:03 
GeneralRe: c# deskew image Pin
OriginalGriff20-Jun-23 4:43
mveOriginalGriff20-Jun-23 4:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.