University project - Electronic Stethoscope

In your case all it does is returns false, because it compares if objects are the same.

And [em]usbSerial.SerialLine[/em] is not equals [em]lightSensor[/em]

you seem to be making pretty random changes to code. Doesn’t sound like you’ve found the reference documents. Head over to http://www.ghielectronics.com/support/dotnet-micro-framework and then you’ll see the 4.2 reference API Reference for .NET Micro Framework | Microsoft Learn and start looking there.