Current section
8 Versions
Jump to
Current section
8 Versions
Compare versions
5
files changed
+6
additions
-5
deletions
| @@ -12,7 +12,7 @@ by adding `elixir_bme680` to your list of dependencies in `mix.exs`: | |
| 12 12 | ```elixir |
| 13 13 | def deps do |
| 14 14 | [ |
| 15 | - {:elixir_bme680, "~> 0.1.2"} |
| 15 | + {:elixir_bme680, "~> 0.1.3"} |
| 16 16 | ] |
| 17 17 | end |
| 18 18 | ``` |
| @@ -18,4 +18,4 @@ | |
| 18 18 | {<<"optional">>,false}, |
| 19 19 | {<<"repository">>,<<"hexpm">>}, |
| 20 20 | {<<"requirement">>,<<"~> 0.4">>}]]}. |
| 21 | - {<<"version">>,<<"0.1.2">>}. |
| 21 | + {<<"version">>,<<"0.1.3">>}. |
| @@ -112,7 +112,7 @@ defmodule Bme680 do | |
| 112 112 | # Private helper functions |
| 113 113 | |
| 114 114 | defp decode_measurement(line) do |
| 115 | - case String.split(line, ",", [trim: true]) do |
| 115 | + case line |> String.trim |> String.split(",", [trim: true]) do |
| 116 116 | ["T:" <> t, "P:" <> p, "H:" <> h, "G:" <> g] -> |
| 117 117 | %Measurement{ |
| 118 118 | temperature: String.to_float(t), |
| @@ -4,7 +4,7 @@ defmodule ElixirBme680.MixProject do | |
| 4 4 | def project do |
| 5 5 | [ |
| 6 6 | app: :elixir_bme680, |
| 7 | - version: "0.1.2", |
| 7 | + version: "0.1.3", |
| 8 8 | elixir: "~> 1.7", |
| 9 9 | compilers: [:elixir_make] ++ Mix.compilers, |
| 10 10 | aliases: aliases(), |
| @@ -46,7 +46,8 @@ void output_measurement(struct bme680_dev gas_sensor, uint16_t meas_period) { | |
| 46 46 | data.pressure / 100.0f, data.humidity / 1000.0f); |
| 47 47 | } |
| 48 48 | |
| 49 | - puts(output); |
| 49 | + fprintf(stdout, "%s\n", output); |
| 50 | + fflush(stdout); |
| 50 51 | } |
| 51 52 | |
| 52 53 | int main(int argc, char* argv[]) |