Welcome to labequipment’s documentation!¶
Arduino Sketches for Lab Equipment¶
Python code for all the different bits of lab kit
Shaker Arduino Sketch¶
-
class
labequipment.arduino.
Arduino
(port=None, rate=9600, wait=True)¶ Bases:
object
-
choose_port
(os='linux')¶
-
flush
()¶
-
ignorelines
(n)¶
-
quit_serial
()¶ Close the serial port
-
read_all
()¶
-
read_serial_bytes
(no_of_bytes)¶ Read a given no_of_bytes from the serial port
-
read_serial_line
()¶ Waits for data in the input buffer then reads a single line from the serial port.
- Outputs:
- text the data from serial in unicode
-
readlines
(n)¶
-
send_serial_line
(text)¶ Send a string over the serial port making sure it ends in a new line .
- Input:
- text the string to be sent to the arduino
-
wait_for_ready
()¶ Ensure the arduino has initialised by waiting for the ‘ready’ command
-
-
labequipment.arduino.
find_port
()¶
Lab Equipment¶
Python code for all the different bits of lab kit
Arduino¶
-
class
labequipment.arduino.
Arduino
(port=None, rate=9600, wait=True)¶ Bases:
object
-
choose_port
(os='linux')¶
-
flush
()¶
-
ignorelines
(n)¶
-
quit_serial
()¶ Close the serial port
-
read_all
()¶
-
read_serial_bytes
(no_of_bytes)¶ Read a given no_of_bytes from the serial port
-
read_serial_line
()¶ Waits for data in the input buffer then reads a single line from the serial port.
- Outputs:
- text the data from serial in unicode
-
readlines
(n)¶
-
send_serial_line
(text)¶ Send a string over the serial port making sure it ends in a new line .
- Input:
- text the string to be sent to the arduino
-
wait_for_ready
()¶ Ensure the arduino has initialised by waiting for the ‘ready’ command
-
-
labequipment.arduino.
find_port
()¶
Lauda Water Bath¶
Omega Temperature and Humidity Sensor¶
Shaker¶
-
class
labequipment.shaker.
Shaker
¶ Bases:
object
-
change_duty
(val)¶
-
init_duty
(val)¶
-
quit
()¶
-
ramp
(start, end, rate, step_size=1, record=False, stop_at_end=False)¶
-
read_all
()¶
-
start_serial
()¶
-
switch_mode
()¶
-
-
labequipment.shaker.
convert_audio_frequency_to_duty_cycle
(freqs)¶ Converts audio frequencies to duty cycle (out of 1000)