log()


輸出程式除錯記錄訊息,統一由 SwiftDuinoDelegate 類別接收。

語法

func log(_ message: String)

參數

message: String 欲輸出之訊息

範例

將讀回的 analog 值,輸出至 logger

//
        // MARK: -- loop routine closure
        //
        duino.loop { duino in
            // Analog Input
            let value = duino.analogRead(pin: 1)
            duino.log("AD0 = \(value)")

            duino.delay(ms: 100)
        }

results matching ""

    No results matching ""