This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Two Arduino sending Data
#1
Hello every one, 

I'd need some help with the writing of an XML file for an experiment in which two arduino send accelerometer data to the phyphox app. 
I am completely new to XML languange so any hel will be appreciated. 

I am using the experiment editor of phyphox. I'll try to explain what I've done and what I am missing. 

-In the Main window of the editor I've just added the title of the experiment

-In the input window I've added two bluetooth modules.
  • Identification: set to right and left, respectively. I'll move the sensors with my right and left hands
  • Device names: right_ARD and left_ARD. I will set the same device names when uploading the codes on the two sensors. 
  • Service UUID: I've left this blank. To connect the sensors to the app is it sufficient the Device Name or do I need this information as well? 
  • Mode: Poll. I need the sensors to send data continuously at a sampling rate of 100 Hz (which I put in the following box). is the correct? 
  • I've checked the Subscribe on start boce as i want to start the experiment manually from the app
  • Config: I cannot understand if I have to change something in this case
  • Output: From what I understood I should add three outputs, one for each axis of the accelerometer. After this I don't know what should I do. Which of these boxes are mandatory to be filled? I can imagine that as Conversion function I should use some from the Float option as it is the format of the variables that I will use to read the accelerometer data on the arduino (as in the random number experiment for BLE). In the characteristic boxes shoul I put the name of the variables that I will use on the arduino code to store the data?

-I didn't consider the Output window as i don't need the app to send data to the sensors

-Views
  • I've added two views with three graphs each, one for each component of the accelerometer data. 
  • I've just change some labels of the graphs and the x y axes

-Analysis
  • I've just created empty buffers and connected them to the graphs. 


This is what I managed to do. 
I'll post the code here 

Code:
<phyphox xmlns="http://phyphox.org/xml" xmlns:editor="http://phyphox.org/editor/xml" version="1.7" editor:version="1.0" locale="en">
    <title>Arduino_acc</title>
    <category>no category</category>
    <description></description>
    <icon format="string">ARD</icon>
    <data-containers>
        <container size="1000" static="false">Output 1</container>
        <container size="1000" static="false">Output 2</container>
        <container size="1000" static="false">Output 3</container>
        <container size="1000" static="false">Output 1 (1)</container>
        <container size="1000" static="false">Output 2 (1)</container>
        <container size="1000" static="false">Output 3 (1)</container>
    </data-containers>
    <input>
        <bluetooth editor:uuid="98" editor:posx="479.6499938964844" editor:posy="8.112518310546875" id="Right" name="Right_ARD"  mode="poll" rate="100" subscribeOnStart="true">
            <config conversion="string"></config>
            <output char="Racc_x" conversion="string">Output 1 (1)</output>
            <output char="Racc_y" conversion="string">Output 2 (1)</output>
            <output char="Racc_z" conversion="string">Output 3 (1)</output>
        </bluetooth>
        <bluetooth editor:uuid="99" editor:posx="18.212499618530273" editor:posy="0" id="Left" name="Left_ARD"  mode="poll" rate="100" subscribeOnStart="true">
            <config conversion="string"></config>
            <output char="Lacc_x" conversion="string">Output 1 (1)</output>
            <output char="Lacc_y" conversion="string">Output 2 (1)</output>
            <output char="Lacc_z" conversion="string">Output 3 (1)</output>
        </bluetooth>
    </input>
    <output>
    </output>
    <analysis sleep="0"  onUserInput="false">
    </analysis>
    <views>
        <view label="right ">
            <graph editor:uuid="130" editor:posx="510.3000183105469" editor:posy="180.4749984741211" label="ACC_R" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="X" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 1 (1)</input>
            </graph>
            <graph editor:uuid="217" editor:posx="509.72503662109375" editor:posy="333.83750915527344" label="ACC_R" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="Y" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 2 (1)</input>
            </graph>
            <graph editor:uuid="230" editor:posx="510.48748779296875" editor:posy="492.5749969482422" label="ACC_R" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="Z" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 3 (1)</input>
            </graph>
        </view>
        <view label="left">
            <graph editor:uuid="143" editor:posx="18.162500381469727" editor:posy="189.51250457763672" label="ACC_L" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="X" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 1 (1)</input>
            </graph>
            <graph editor:uuid="243" editor:posx="16.800000190734863" editor:posy="343.0749969482422" label="ACC_L" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="Y" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 2 (1)</input>
            </graph>
            <graph editor:uuid="256" editor:posx="14.20001220703125" editor:posy="508.45001220703125" label="ACC_L" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="time" labelY="Z" labelZ="" unitX="" unitY="" unitZ="" logX="false" logY="false" logZ="false" xPrecision="3" yPrecision="3" zPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">Output 3 (1)</input>
            </graph>
        </view>
    </views>
    <export>
    </export>
</phyphox>


I'll attach the phyphox file here.

If anyone could help me I would be grateful. 

Tanks in advance!!


Attached Files
.phyphox   ARD.phyphox (Size: 1.54 KB / Downloads: 81)
Reply


Messages In This Thread
Two Arduino sending Data - by PBra - 09-15-2023, 12:29 AM
RE: Two Arduino sending Data - by PBra - 09-15-2023, 11:11 AM
RE: Two Arduino sending Data - by PBra - 09-15-2023, 09:07 PM
RE: Two Arduino sending Data - by Dominik Dorsel - 09-21-2023, 10:33 AM
RE: Two Arduino sending Data - by PBra - 09-21-2023, 12:02 PM

Forum Jump: