made a ui code utilizing Sprint/Plotly, i have to import a number of sensor information from an arduino onto my Python file utilizing a Raspberry pi how you can proceed?

import sprint
import dash_daq as daq
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import webbrowser


external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css', dbc.themes.CYBORG]

app = sprint.Sprint(__name__, external_stylesheets=external_stylesheets)

app.format = html.Div([
    dbc.Row([
            dbc.Card([daq.LEDDisplay(
                                id='my-temp',
                                value="00",
                                color="#9B51E0",
                                backgroundColor="black",
                                size="36",
                            )
                            ], type={'alignItems': 'middle', 'background-color': "black", 'padding-left': "200px"}),
        dcc.Interval(id='in', interval=0.2 * 1000, n_intervals=0)
    ])
])


@app.callback(
    sprint.dependencies.Output('my-display', 'worth'),
    [dash.dependencies.Input('in', 'n_intervals')],
)
def update_output(n):
    show = rand
    print(show)
    return show


if __name__ == '__main__':
    webbrowser.open('http://127.0.0.1:8050/')
    app.run_server(debug=False, port=8050, use_reloader=False)

Now i would like sensor information from arduino utilizing serial port to be displayed on this UI can anybody inform me how you can do it ? I'm Utilizing serial port to attach the arduino to my raspberry pi.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *