-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Williangalvani/python
Improve Python interface Add example
- Loading branch information
Showing
3 changed files
with
99 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from exposer import SerialExposer # Imports the communication module | ||
|
||
# Instantiate a "SerialExposer" object named "comm" | ||
comm = SerialExposer("/tmp/simavr-uart0") | ||
|
||
# Setup phase, this requests all the variable names and types to the other side | ||
comm.requestAll() | ||
|
||
# This will print all of the received variable names | ||
print(comm.getVarNames()) | ||
|
||
# Equivalent to "testuint8 = 0;" | ||
comm.setVar("testuint8",10) | ||
|
||
# Equivalent to "testuint8 = 0;" | ||
print(comm.getVar("testuint8")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters