コード例 #1
0
from ArduinoGate import ArduinoGate
from Monaco import Monaco
import time
import sys

#Instantiate Classes
laser = Monaco(Port_id='com1', power=80, pulse_freq=1000)
gate = ArduinoGate(port='com4', baudrate=9600, timeout=5)

#Laser Set-up
laser.set_parameters(power=5, RRD=100)
bursts = input('No. Pulses: ')
laser.serial_write('BP=' + str(bursts))

#Begin test
startPower = 5
endPower = 100
Step = 2

laserPowers = list(range(startPower, endPower, Step))

laser.start_lasing()
for power in laserPowers:

    laser.set_parameters(power=power)
    #Confirmation
    print('Power: ', power)
    confirm = input('Fire Laser? (y/n)')

    if confirm == 'y':
        gate.quick_open(500)
コード例 #2
0
ファイル: gateTest2.py プロジェクト: N0AHt/AutoMonaco
from ArduinoGate import ArduinoGate
from Monaco import Monaco
import time

laser = Monaco(Port_id='com1', power=80, pulse_freq=1000)
gate = ArduinoGate(port='com4', baudrate=9600, timeout=5)

laser.set_parameters(RRD=1)
laser.activate_laser(1)  #gated Mode

laser.start_lasing()

for i in range(5):
    open_time = input('Delay: ')
    gate.quick_open(open_time)
    time.sleep((int(open_time) / 1000) *
               1.2)  #stops laser stopping before final gate closes
    print('output: ', gate.serial_read())

laser.stop_lasing()
コード例 #3
0
from ArduinoGate import ArduinoGate
from Monaco import Monaco
import numpy as np
import time
import sys

#set to 10kHz
laser = Monaco(Port_id = 'com1', power = 50.5, pulse_freq = 1000)
gate = ArduinoGate(port ='com4', baudrate = 9600, timeout = 5)

# #Laser Set-up
# laser.set_parameters(power = 5, RRD = 100)
# #set to 100 pulses (10ms)
# laser.serial_write('BP=100')

PRR = [100,
10,
100,
1000,
1000,
10,
100,
10,
100,
100,
100,
1000,
100,
1000,
1000,
1000,
コード例 #4
0
ファイル: 1000kHz_pulsing.py プロジェクト: N0AHt/AutoMonaco
from ArduinoGate import ArduinoGate
from Monaco import Monaco
import numpy as np
import time
import sys

#set to 10kHz
laser = Monaco(Port_id='com1', power=50.5, pulse_freq=1000)
gate = ArduinoGate(port='com4', baudrate=9600, timeout=5)

#Laser Set-up
laser.set_parameters(power=5, RRD=1)
#set to 40 pulses
laser.serial_write('BP=4000')


def solve_for_y(poly_coeffs, y):
    #stackoverflow: https://stackoverflow.com/questions/16827053/solving-for-x-values-of-polynomial-with-known-y-in-scipy-numpy
    pc = poly_coeffs.copy()
    pc[-1] -= y
    return np.roots(pc)


def Watt2RL(desired_power):
    #desired power must be in range
    polynom = [
        -3.89619018e-18, 1.43681797e-15, -1.71273526e-13, 8.88299244e-13,
        1.54934881e-09, -1.41594079e-07, 4.87160468e-06, -4.11977712e-05,
        2.31567217e-04, 2.70908813e-03, -1.08571654e-02
    ]
    roots = solve_for_y(polynom, desired_power)
コード例 #5
0
from ArduinoGate import ArduinoGate
from Monaco import Monaco
import time

laser = Monaco(Port_id='com1', power=50.5, pulse_freq=1000)
gate = ArduinoGate(port='com4', baudrate=9600, timeout=5)

#laser.activate_laser(5)

laser.set_parameters(RRD=4)
#laser.activate_laser(4)
bursts = input('No. Pulses: ')
laser.serial_write('BP=' + str(bursts))

laser.status_report()

laser.start_lasing()

#time.sleep(5)

print('opening gate')

gate.quick_open(5000)

time.sleep(10)

gate.quick_open(1000)
time.sleep(5)

laser.stop_lasing()
コード例 #6
0
from Monaco import Monaco
import time

#show available ports
print('Port list: ', Monaco.port_finder())

#input device port
port = input('input port: ')


laser = Monaco(Port_id = port, power = 10, pulse_freq = 10)

laser.stop_lasing()
laser.deactivate_laser()
コード例 #7
0
ファイル: RL_test.py プロジェクト: N0AHt/AutoMonaco
from Monaco import Monaco
import time

port = 'com1'
laser = Monaco(Port_id = port, power = 10, pulse_freq = 1000)
RL_values = [5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100]



for RL in RL_values:

    laser.status_report()
    laser.set_parameters(power = RL)
    print('POWER: ',laser.power)
    laser.start_lasing()
    time.sleep(10)
    laser.stop_lasing()
コード例 #8
0
ファイル: LaserStart.py プロジェクト: N0AHt/AutoMonaco
#start up for laser

from Monaco import Monaco
import time

#show available ports
print('Port list: ', Monaco.port_finder())
#input device port
port = input('input port: ')

#Open port and check connection is secure
laser = Monaco(Port_id=port, power=10, pulse_freq=10)
laser.hello_laser()

laser.start_up()

#turn on diodes with continuous pulsing
laser.activate_laser(5)
コード例 #9
0
from Monaco import Monaco
import time

#show available ports
print('Port list: ', Monaco.port_finder())
#input device port
port = input('input port: ')

#Open port and check connection is secure
laser = Monaco(Port_id = port, power = 10, pulse_freq = 10)
laser.serial_write('LOCKOUT=0')
print('unlocked laser port')
コード例 #10
0
ファイル: DIBS.py プロジェクト: Jetidball/DIBS2.1
from FFXIV import FFXIV
from TicTacToe import TicTacToe
from Overwatch import Overwatch
from Chess import Chess
from Timer import Timer
from Cinemark import Cinemark
from SoundVoice import SoundVoice
import Token

if not discord.opus.is_loaded():
    discord.opus.load_opus("libopus.so")

bot = commands.Bot(command_prefix='$', description='I am here to serve')

bot.add_cog(Stocks(bot))
bot.add_cog(Monaco(bot))
bot.add_cog(MagicCard(bot))
bot.add_cog(FFXIV(bot))
bot.add_cog(TicTacToe(bot))
bot.add_cog(Overwatch(bot))
bot.add_cog(Chess(bot))
bot.add_cog(Cinemark(bot))
bot.add_cog(Timer(bot))
#bot.add_cog(SoundVoice(bot))


@bot.event
async def on_ready():
    print('Logged in as')
    print(bot.user.name)
    print(bot.user.id)
コード例 #11
0
from Monaco import Monaco
import time

port = 'com1'
laser = Monaco(Port_id=port, power=10, pulse_freq=1000)
error = laser.serial_write('RL=52.713')

print(error)

print('done')

rl = laser.serial_write('?RL')

print('RL =', rl)
print('done')

# laser.start_lasing()
#
# time.sleep(5)
#
# laser.stop_lasing()