コード例 #1
0
 // Method
 //
 public static bool Init()
 {
     Log.Module = Module;
     if (!_connected)
     {
         if (RoBoIO.spi_Initialize(RoBoIO.SPICLK_21400KHZ))
         {
             _connected = true;
             Log.WriteLineSucces("Opening: SPI lib");
             return(true);
         }
         _connected = false;
         Log.WriteLineFail("Opening: SPI lib");
         Log.WriteLineError(string.Format("SPI lib fails to initialize ({0})", RoBoIO_DotNet.RoBoIO.roboio_GetErrMsg()));
         return(false);
     }
     Log.WriteLineMessage("Opening: SPI lib...already open");
     return(true);
 }