Instrument control package: Difference between revisions
Jump to navigation
Jump to search
→Example: basic use
Line 95: | Line 95: | ||
Chaging some configurations is simple done by calling helper functions | Chaging some configurations is simple done by calling helper functions | ||
{{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px"> | {{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px"> | ||
set(s1, 'baudrate', 9600) # Change baudrate | |||
set(s1, 'bytesize', 5) # Change byte size (config becomes 5-N-1) | |||
set(s1, 'parity', "E") # Changes parity checking (config becomes 5-E-1), | |||
# possible values [E]ven, [O]dd, [N]one. | |||
set(s1, 'stopbits', 2) # Changes stop bits (config becomes 5-E-2), possible | |||
# values 1, 2. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |