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

modified step 1 command on README.md #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ Then use a Qt interface to query the value in the arduino.

Create an arduino driver, the corresponding sketch and upload it.
Then use a Qt interface to query the value in the arduino periodically
or plot it.
or plot it.

#### arduino-qt-toogle-led

Create an arduino driver, the corresponding sketch and upload it.
The use a Qt interface with ON OFF buttons to set an arduino LED.
183 changes: 96 additions & 87 deletions arduino-qt-continuous/README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,96 @@
arduino-qt-continuous
=====================

This example shows:
- how to build an instrument that communicates via
exchanging text messages using arduino and lantz.
- how to query that instrument periodically
- how to plot the results in a chart


Requirements
------------

- Install the latest version of lantz

- Install arduino-cli
https://github.com/arduino/arduino-cli

- (optionally) Install pyqtgraph if you want to run the run_plot example

- Copy all the content of this folder to your computer

If you do not have the NI-VISA installed, you need to install `pyvisa-py`
(the pure python backend for pyvisa) and tell lantz to use it by default

In the command line:

pip install pyvisa-py
pip install pyserial
lantz config core.visa_backend '@py'


Step 1: Create arduino sketch template
--------------------------------------

In the console, go to the folder containing this project and execute the following
command:

lantz ino new drivers:TemperatureSensor

This will generate a arduino sketch template for the class `TemperatureSensor`
located in the `run` module. You will find it in the TemperatureSensor folder.
It additionally creates a "packfile" named `TemperatureSensor.pack.yaml` that
contains information to compile and upload the project.


Step 2 (optional): Add your own code to the arduino sketch
----------------------------------------------------------

You can customize the arduino code by editing `inodriver_user.cpp` and
`inodriver_user.h` within the sketch folder.

You will find the following functions:

- user_setup: this will be executed during the setup of the arduino just before starting
the communication with the serial command.

- user_loop: this will be executed every time the main loop is executed

- ... and one function for each getter/setter you have in your lantz code.

You can just use the default code to get working but dummy example.


Step 3: Run it
--------------

In the console, go to the folder containing this project and execute the following
command:

python run_display.py


Step 4 (optional): Change something in the arduino sketch
---------------------------------------------------------

Edit `inodriver_user.cpp`, for example to return 42.0 from `get_TEMP`
and run the code again. Notice that lanz recompiles and upload the sketch!


Step 5 (optional): Run the plotting example
-------------------------------------------

In the console, go to the folder containing this project and execute the following
command:

python run_plot.py
arduino-qt-continuous
=====================

This example shows:
- how to build an instrument that communicates via
exchanging text messages using arduino and lantz.
- how to query that instrument periodically
- how to plot the results in a chart


Requirements
------------

- Install the latest version of lantz

- Install arduino-cli
https://github.com/arduino/arduino-cli

_windows:_
Make sure you included the arduino-cli in your enviroment variables PATH.
From the command prompt:
* Check your installation by doing `arduino-cli`
* Install the AVR dependencies `arduino-cli core install arduino:avr`


- (optionally) Install pyqtgraph if you want to run the run_plot example

- Copy all the content of this folder to your computer

If you do not have the NI-VISA installed, you need to install `pyvisa-py`
(the pure python backend for pyvisa) and tell lantz to use it by default

In the command line:

pip install pyvisa-py
pip install pyserial
lantz config core.visa_backend '@py'


Step 1: Create arduino sketch template
--------------------------------------

In the console, go to the folder containing this project and execute the following
command:

lantz ino new drivers:TemperatureSensor

This will generate a arduino sketch template for the class `TemperatureSensor`
located in the `run` module. You will find it in the TemperatureSensor folder.
It additionally creates a "packfile" named `TemperatureSensor.pack.yaml` that
contains information to compile and upload the project.


Step 2 (optional): Add your own code to the arduino sketch
----------------------------------------------------------

You can customize the arduino code by editing `inodriver_user.cpp` and
`inodriver_user.h` within the sketch folder.

You will find the following functions:

- user_setup: this will be executed during the setup of the arduino just before starting
the communication with the serial command.

- user_loop: this will be executed every time the main loop is executed

- ... and one function for each getter/setter you have in your lantz code.

You can just use the default code to get working but dummy example.


Step 3: Run it
--------------

In the console, go to the folder containing this project and execute the following
command:

python run_display.py

If you get a __json error__ read carfully the notes it states you should update the index using `arduino-cli core-update index`


Step 4 (optional): Change something in the arduino sketch
---------------------------------------------------------

Edit `inodriver_user.cpp`, for example to return 42.0 from `get_TEMP`
and run the code again. Notice that lanz recompiles and upload the sketch!


Step 5 (optional): Run the plotting example
-------------------------------------------

In the console, go to the folder containing this project and execute the following
command:

python run_plot.py
152 changes: 80 additions & 72 deletions arduino-qt-simple/README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,80 @@
arduino-qt-simple
=================

This is a very simple example of how to build an instrument that communicates via
exchanging text messages using arduino and lantz.

Requirements
------------

- Install the latest version of lantz

- Install arduino-cli
https://github.com/arduino/arduino-cli

- Copy all the content of this folder to your computer

If you do not have the NI-VISA installed, you need to install `pyvisa-py`
(the pure python backend for pyvisa) and tell lantz to use it by default

In the command line:

pip install pyvisa-py
pip install pyserial
lantz config core.visa_backend '@py'


Step 1: Create arduino sketch template
--------------------------------------

In the console, go to the folder containing this project and execute the following
command:

lantz ino new run:TemperatureSensor

This will generate a arduino sketch template for the class `TemperatureSensor`
located in the `run` module. You will find it in the TemperatureSensor folder.
It additionally creates a "packfile" named `TemperatureSensor.pack.yaml` that
contains information to compile and upload the project.


Step 2 (optional): Add your own code to the arduino sketch
----------------------------------------------------------

You can customize the arduino code by editing `inodriver_user.cpp` and
`inodriver_user.h` within the sketch folder.

You will find the following functions:

- user_setup: this will be executed during the setup of the arduino just before starting
the communication with the serial command.

- user_loop: this will be executed every time the main loop is executed

- ... and one function for each getter/setter you have in your lantz code.

You can just use the default code to get working but dummy example.


Step 3: Run it
--------------

In the console, go to the folder containing this project and execute the following
command:

python run.py


Step 4 (optional): Change something in the arduino sketch
---------------------------------------------------------

Edit `inodriver_user.cpp`, for example to return 42.0 from `get_TEMP`
and run the code again. Notice that lanz recompiles and upload the sketch!
arduino-qt-simple
=================

This is a very simple example of how to build an instrument that communicates via
exchanging text messages using arduino and lantz.

Requirements
------------

- Install the latest version of lantz

- Install arduino-cli
https://github.com/arduino/arduino-cli

_windows:_
Make sure you included the arduino-cli in your enviroment variables PATH.
From the command prompt:
* Check your installation by doing `arduino-cli`
* Install the AVR dependencies `arduino-cli core install arduino:avr`

- Copy all the content of this folder to your computer

If you do not have the NI-VISA installed, you need to install `pyvisa-py`
(the pure python backend for pyvisa) and tell lantz to use it by default

In the command line:

pip install pyvisa-py
pip install pyserial
lantz config core.visa_backend @py


Step 1: Create arduino sketch template
--------------------------------------

In the console, go to the folder containing this project and execute the following
command:

lantz ino new run:TemperatureSensor

This will generate a arduino sketch template for the class `TemperatureSensor`
located in the `run` module. You will find it in the TemperatureSensor folder.
It additionally creates a "packfile" named `TemperatureSensor.pack.yaml` that
contains information to compile and upload the project.


Step 2 (optional): Add your own code to the arduino sketch
----------------------------------------------------------

You can customize the arduino code by editing `inodriver_user.cpp` and
`inodriver_user.h` within the sketch folder.

You will find the following functions:

- user_setup: this will be executed during the setup of the arduino just before starting
the communication with the serial command.

- user_loop: this will be executed every time the main loop is executed

- ... and one function for each getter/setter you have in your lantz code.

You can just use the default code to get working but dummy example.


Step 3: Run it
--------------

In the console, go to the folder containing this project and execute the following
command:

python run.py

If you get a __json error__ read carfully the notes it states you should update the index using `arduino-cli core-update index`


Step 4 (optional): Change something in the arduino sketch
---------------------------------------------------------

Edit `inodriver_user.cpp`, for example to return 42.0 from `get_TEMP`
and run the code again. Notice that lanz recompiles and upload the sketch!
Loading