Imports Emant
Module Module1

    Sub Main()
        Dim volt, lux, compare As Double
        Dim input As String
        Console.WriteLine("Light Threshold in Lux")
        input = Console.ReadLine
        compare = Convert.ToDouble(input)
        Dim DAQ As Emant300 = New Emant300
        DAQ.Open()
        volt = DAQ.ReadAnalog(Emant300.AIN.AIN0, Emant300.AIN.COM)
        lux = 1333 * volt
        Console.WriteLine(lux)
        If lux < compare Then
            DAQ.WriteDigitalBit(0, True)
        Else
            DAQ.WriteDigitalBit(0, False)
        End If
        DAQ.Close()
    End Sub

End Module
