on Play warning sound Communicate through GPIO Communicate using Vapor SwiftHome Read Suica ID using card reader Use iPhone Sensors Collaborate with Home appliance Run Bash from Swift Run Python from Swift Run Swift on Raspberry Pi
--help $ vapor new SwiftHomeServer > Would you like to use Fluent? (--fluent/--no-fluent) > Which database would you like to use? (--fluent.db) > Would you like to use Leaf? (--leaf/--no-leaf) # ① Select using Fluent or not. (ORM framework for Swift.) #→ y # ②Select database(If using in Heroku, ‘Postgres’ is required.) #→ y # ③Select using Leaf or not.(a powerful templating language with Swift-inspired syntax.) #→ y or n(this time, n) Vaporのセットアップ
7 8 9 10 sckGpio. dataIn: { sckGpio. dataIn (dataIn ) (dataGpio. ) sckGpio. } maxValue: minValue: value 0 UInt32 0 _ 0 24 value 1 1 UInt32 value value 0 UInt32 16777215 UInt32 8388608 = var = for in ..< = = << | = let = let = // ①24bitのデータを1bitずつ取得 // ②左ビットシフト→新しいbitをORで反映 // 0x7fffff(16777215) is Max value, 0x800000(8388608) is Min value // ③HX711のリファレンス記載の最大データ // ④HX711のリファレンス記載の最小データ GpioManager.swift 重量センサーのデータを読み取る③