How do you use a Wheatstone Bridge to calculate Resistance using Bluetooth?

For a PhD candidate, this is poor quality code.

Using a name like 'time' for a variable is just plain shoddy.

It caused you to trip over your own nomenclature failure, when you were writing to a File.

I expect to see variable names fleshed out with more context in future code submissions, like StartTimeinMillisecondsfrom1970.

Ai2 has full capabilities for renaming variables and keeping references to those variables in sync.

Use them.

This might help

You also can search the community to find more ideas...

Taifun

The Companion is a separate app from whatever app you build.

Some versions of Android prevent one app from overwriting a file written by another app.

Try a different file name.

Other sources of crashes on a newly built app may include:

  • Poorly chosen TinyDb default values kicking in
  • Lack of Permissions for BlueTooth
1 Like

I changed it, but the timing is starting hours: minutes: seconds, but I need it as seconds only on x axis.

Yes, instead of gauge I will use bar made by canvas as it will be much easier. Thanks :pray:


So please how I can do like this or even circle with increasing the colours and changing the colours with increasing the concentration by ppm

FRgn7

I can't support JavaScript solutions, though I might collect links to them on this board.

Thanks, I meant how I can make normal bar or circle using canvas to make three layers of notification or alert.

Study the Canvas component.

You could always just use three labels (no text) with background colours and set the height/width to match your values

image

2 Likes

Here is a working multicolor bar graph of the current load on the MIT Build Servers

Note how the bar colors change from green to yellow to red as the load increases.

1 Like

Too difficult?? Not really difficult but it is not simple.

:wink:

1 Like

Thanks. The problem is with the header ((arrow)) going to the left side. please, send me the aia file.

This is very nice.
Thank you so much.

image

Please, if possible, send me the aia file, as I changed the color ranges and water gauge to ppm, but the header (needle) is not working. Furthermore, I need to change the width and height to fit the app screen. ((Thanks I did it, now it is working))

Also, if you please, help me with the x-axis of the chart, as I need it to read only in seconds, not in milliseconds time since 1970.
(Remaining the x-axis in seconds.
Maybe I can send elapsedTimeSeconds on x axis and R_Unknown on y axis, but how I can do it.

Also, if you please, help me with the x-axis of the chart, as I need it to read only in seconds, not in milliseconds time since 1970.
(Remaining the x-axis in seconds.
Maybe I can send elapsedTimeSeconds on the x-axis and R_Unknown on the y-axis, but how can I do it? Please, I have tried many times to make the x-axis as time in seconds.
For the gauge, I need to connect it to ppm math to work automatically in the app.
Also, in the last version of the app, I will take the R y-axis from the math calculation of the Wheatstone bridge, so how can I do it?
BELAL2025NANOMADVERSION7 (1).aia (1.1 MB)

Thanks @ABG Also, now it can analyze the R air and R gas

image
when I press stop, the timer is still counting

ppmGauge.aia (46.7 KB)

Good luck. This should work when connected to your app's ppm data stream.

Modify the GCppm2.html that is stored in media to get the centering of the gauge as you like it. :grinning:

1 Like

Thank you so much @SteveJG

This is helpful
For my previous question I will check it

I have turned off Windows Defender examination of aia files, so I can examine your aia file.

Here is a set of blocks I must change, for readability and correctness:

old:
blocks

new:
blocks (3)

Do you see the difference between elapsed time and absolute System time?
Elapsed means you have subtracted start time from end time to get the difference.
But that is not what is being stored in this variable, as you will see further down.

old:

new:

Notice how the global variable name change makes more sense, where SystemTime of start is being subtracted from current SystemTime, giving elapsed milliseconds, then rounded into seconds.

Those seconds are being loaded into item 1 of each (time, R_Unknown) pair in list global readings. That's handy for later, when we need a list of Labels for the Chart.
image
(I have no idea why you are loading a Web URL. It's not like you are issuing any Web Gets to it. That makes your app look like a product of a cargo cult.)

I hovered my cursor over the green Set Chart1.Labels block, to raise its tool tip.
That's how I know it needed a list of x values, and not that R value you had before.

I also set the chart GridEnabled to true, since I am guessing you wanted a grid, from that ineffective block you originally had setting the setting to itself, which would have done absolutely nothing. If you don't want a grid, set it to false.

old:

new (after variable rename):


(Same deal with the Web URL mumbo jumbo)

This should clear the error message on setting Labels.

All blocks are draggable.

I suggest you drag in the init global startSystemTime first, since all the other blocks depend on it.

1 Like

By the way, I did not correct your file naming convention.

Operating systems expect file names to have suffixes (.text, .json, .csv, .html, .exe, ...) as an aid to knowing what programs eat them.

Since you have written your file to contain text Comma Separated Values (CSV), you should add the suffix .csv to the file name, as a courtesy to the operating system and any one else dealing with that file.

1 Like


Thank you so much @ABG
ValueFormat, I changed from time to Decimal, and it is now counting in 1, 2, 3, ..........