Arduino

arduino
Fig. 1. Arduino Uno

Sample Python code talking to instruments over GPIB and Arduino concurrently

			
				import visa
				import serial

				## GPIB
				rm = visa.ResourceManager()
				print(rm.list_resources())
				SCOPE = rm.open_resource('GPIB0::6::INSTR')
				AWG = rm.open_resource('GPIB0::4::INSTR')
				DS345 = rm.open_resource('GPIB0::19::INSTR')
				##N9320B = rm.open_resource("USB0::0x0957::0xFFEF::CN03224017::INSTR")

				print(rm)
				print(SCOPE.query('*IDN?'))
				print(AWG.query('*IDN?'))
				print(DS345.query('*IDN?'))
				##print(N9320B.query('*IDN?'))

				SCOPE.write('TIME_DIV .5 MS')

				## arduino
				ser = serial.Serial("COM6")
				print ser.name
				ser.write("1")
			
		

References:

  1. Arduino Uno
  2. Download the Arduino IDE
  3. Arduino Tutorial #1 - Getting Started and Connected!
  4. LED blink tutorial
  5. Arduino and Python
  6. pyserial
© 2018 Copyright. For individual use only. No liability is accepted for any consequences of using information on Testips.com.