]> Git — Sourcephile - julm/air-duino.git/commitdiff
update, using nix master
authorJulien Moutinho <julm@sourcephile.fr>
Sun, 17 Jan 2021 16:59:13 +0000 (17:59 +0100)
committerJulien Moutinho <julm@sourcephile.fr>
Sun, 17 Jan 2021 17:07:12 +0000 (18:07 +0100)
14 files changed:
GNUmakefile
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]
libraries/AirQuality_Sensor [new symlink]
libraries/DustSensor [new symlink]
libraries/Grove_Air_quality_Sensor [new submodule]
libraries/Grove_Dust_Sensor [new submodule]
libraries/Grove_High_Precision_RTC_PCF85063TP [new submodule]
libraries/Grove_Temperature_And_Humidity_Sensor [new submodule]
libraries/Humidity_Temperature_Sensor [new symlink]
libraries/OLED_Display_96X96 [new submodule]
libraries/RTC [new symlink]
send.ino
shell.nix [new file with mode: 0644]

index 52b7c637db3bf8dc7917ad3a52479eab5028dbf5..2bb37e78a2d1ca7ab9baecb6a28dcf332caf66eb 100644 (file)
@@ -43,11 +43,6 @@ RRD_CF := AVERAGE
 ## INO
 ###
 
-# For GNU/Linux
-ARDUINO_DIR   := /usr/share/arduino/
-ARDMK_DIR     := /usr/share/arduino/
-AVR_TOOLS_DIR := /usr
-
 # For Seeeduino
 BOARD_TAG := uno
 
@@ -55,12 +50,13 @@ ARDUINO_LIBS := \
  AirQuality_Sensor \
  DustSensor \
  Humidity_Temperature_Sensor \
LCD_Display9696 \
- RTC \
OLED_Display_96X96 \
+ RTC_DS1307 \
  Wire
  #Grove_Barometer_HP20x
+ #LCD_Display9696 \
 
-USER_LIB_PATH := $(realpath ./libraries)
+#USER_LIB_PATH := $(realpath ./libraries)
 
 ifeq ($(NO_INO),)
 include $(ARDMK_DIR)/Arduino.mk
diff --git a/flake.lock b/flake.lock
new file mode 100644 (file)
index 0000000..4e573e4
--- /dev/null
@@ -0,0 +1,38 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "locked": {
+        "lastModified": 1610051610,
+        "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "narHash": "sha256-5KpQQpxDgan0g3+ynPBoZXujR2jUdAQSYIJdwl7j7pk=",
+        "path": "/nix/store/byb4g2xx02nklia8i7fdfxp3qrf8cp1q-nixpkgs-patched",
+        "type": "path"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644 (file)
index 0000000..11a6b55
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,11 @@
+{
+inputs.nixpkgs.url = "flake:nixpkgs";
+inputs.flake-utils.url = "github:numtide/flake-utils";
+outputs = inputs:
+  inputs.flake-utils.lib.eachDefaultSystem (system:
+    let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
+    {
+    devShell = import ./shell.nix { inherit inputs pkgs; };
+    }
+  );
+}
diff --git a/libraries/AirQuality_Sensor b/libraries/AirQuality_Sensor
new file mode 120000 (symlink)
index 0000000..99d124c
--- /dev/null
@@ -0,0 +1 @@
+Grove_Air_quality_Sensor
\ No newline at end of file
diff --git a/libraries/DustSensor b/libraries/DustSensor
new file mode 120000 (symlink)
index 0000000..7d996b3
--- /dev/null
@@ -0,0 +1 @@
+Grove_Dust_Sensor
\ No newline at end of file
diff --git a/libraries/Grove_Air_quality_Sensor b/libraries/Grove_Air_quality_Sensor
new file mode 160000 (submodule)
index 0000000..93f5ba4
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 93f5ba4c0fa03a9193e5f4aca5cc9af957c08f9e
diff --git a/libraries/Grove_Dust_Sensor b/libraries/Grove_Dust_Sensor
new file mode 160000 (submodule)
index 0000000..c0d9094
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c0d90940df1db6b3c53b8b5945aac4864d858003
diff --git a/libraries/Grove_High_Precision_RTC_PCF85063TP b/libraries/Grove_High_Precision_RTC_PCF85063TP
new file mode 160000 (submodule)
index 0000000..4ff0e9d
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 4ff0e9ddae575a77b443a29ae74b889b4993209a
diff --git a/libraries/Grove_Temperature_And_Humidity_Sensor b/libraries/Grove_Temperature_And_Humidity_Sensor
new file mode 160000 (submodule)
index 0000000..f6df6d8
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f6df6d853728f2f04475861cfcc77ddd4b92213b
diff --git a/libraries/Humidity_Temperature_Sensor b/libraries/Humidity_Temperature_Sensor
new file mode 120000 (symlink)
index 0000000..1847c32
--- /dev/null
@@ -0,0 +1 @@
+Grove_Temperature_And_Humidity_Sensor
\ No newline at end of file
diff --git a/libraries/OLED_Display_96X96 b/libraries/OLED_Display_96X96
new file mode 160000 (submodule)
index 0000000..ecacdd0
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ecacdd0ac918c7d0340ce338bafbf7f0dc0867bd
diff --git a/libraries/RTC b/libraries/RTC
new file mode 120000 (symlink)
index 0000000..2e755f3
--- /dev/null
@@ -0,0 +1 @@
+Grove_High_Precision_RTC_PCF85063TP
\ No newline at end of file
index 034957992b7b7dc66bf93baea7a66d7ace1ba1bf..bef4039ea8f977986cc5752ae6282baf013f4b77 100644 (file)
--- a/send.ino
+++ b/send.ino
@@ -62,7 +62,8 @@ void loop_serial_read () {
 
 /* Oled */
 void setup_oled () {
-       SeeedGrayOled.init();
+       //SeeedGrayOled.init(SH1107G);
+       SeeedGrayOled.init(SSD1327);
        SeeedGrayOled.clearDisplay();
        SeeedGrayOled.setNormalDisplay(); // Set display to normal mode (i.e non-inverse mode)
        SeeedGrayOled.setVerticalMode();
@@ -202,7 +203,7 @@ void loop_dht () {
                SeeedGrayOled.setTextXY(2,0);
                SeeedGrayOled.putString("T:          ");
                SeeedGrayOled.setTextXY(2,3);
-               SeeedGrayOled.putFloat(t);
+               SeeedGrayOled.putNumber(t);
                SeeedGrayOled.putString("*C");
                
         }
@@ -218,7 +219,7 @@ void loop_dht () {
                SeeedGrayOled.setTextXY(3,0);
                SeeedGrayOled.putString("H:          ");
                SeeedGrayOled.setTextXY(3,3);
-               SeeedGrayOled.putFloat(h);
+               SeeedGrayOled.putNumber(h);
                SeeedGrayOled.putString("%");
         }
  }
@@ -339,9 +340,9 @@ void loop_fire () {
                SeeedGrayOled.setTextXY(7,0);
                SeeedGrayOled.putString("Feu:        ");
                SeeedGrayOled.setTextXY(7,5);
-               //SeeedGrayOled.putFloat(mq9_ratio);
+               //SeeedGrayOled.putNumber(mq9_ratio);
                //Serial.print(mq9_ratio);
-               SeeedGrayOled.putFloat(mq9_R0_);
+               SeeedGrayOled.putNumber(mq9_R0_);
         }
  }
 
diff --git a/shell.nix b/shell.nix
new file mode 100644 (file)
index 0000000..e4657e2
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,27 @@
+{ inputs, pkgs, ... }:
+pkgs.mkShell {
+  name = "air-duino";
+  src = null;
+  #preferLocalBuild = true;
+  #allowSubstitutes = false;
+  buildInputs = with pkgs; [
+    arduino
+    arduino-core
+    arduino-mk
+    gcc
+    gcc-arm-embedded
+    avrdude
+  ];
+  #enableParallelBuilding = true;
+
+  ARDUINO = pkgs.arduino;
+  ARDUINO_PATH = pkgs.arduino-core;
+  ARDUINO_DIR = pkgs.arduino-core + "/share/arduino";
+  ARDMK_DIR = pkgs.arduino-mk;
+  AVR_TOOLS_DIR = pkgs.arduino + "/share/arduino/hardware/tools/avr";
+  USER_LIB_PATH = toString ./. + "/libraries";
+
+  #PATH="${pkgs.arduino + "/share/arduino/hardware/tools/avr/bin"}:$PATH"
+  shellHook = ''
+  '';
+}