In this section I will describe step by step how to get the arduino project from GitHub on to your Arduino Nano. Using the arduino webeditor. Note: the free plan has only 200s of compilation time a day. During my experiments I ran out of compilation time sometimes. In that case a local installation will be better or just wait a day ;)
- download the project from the master
- transform the "millControl" folder into a ZIP file
- open the WebEditor on arduino.cc
- connect the arduino
- choose your arduino and the coorect bootloader (I did it by try and error)
- go to sketchbook
- click import
- choose the "millControl.zip" file and upload it
- during the import it will tell you that some of the folder's XYZ files do not contain something. You can accept it.
- depending on the relais (high or low trigger) you need to adjust the settings (see below Config changes for the relais)
- for the arduino nano you will need to change some configurations (see below Config changes for the arduino nano)
- depending on the display i2c or spi you need to adjust the settings (see below Config changes for the display)
- select "MillControll.ino" from the tab in the WebEditor on arduino.cc
- click on verify and save
- it should say "Success: ...."
- If you imported only the "MillControll.ino" file, you will get a bunch of errors during "verify and save" because of missing files
- connect the arduino
- make sure that "MillControll.ino" is still selected from the tab
- hit the upload and save button
- after flash is complete you should see the first screen on the display of the arduino nano
The values for the PINs can be found here demoSetup.md
- MillControll.ino line 65: Rotator *UI::rotator = new RotatingEncoder(<CLK Pin>, <DT PIN>);
- MillControll.ino line 77: ENCODER_BUTTON <SW PIN>
- in UI.h line 32: MILL_BUTTON = <Taster Signal PIN>
- in UI.h line 36: MILL_BUTTON_2 = <Taster 2 Signal PIN> or comment out
- in UI.h line 109: Relais Pin = <Relais Signal PIN>
Depending on the used relay you may need to change following lines. My Relais triggers on High signal so I had to change:
- Run.cpp line 7: digitalWrite(UI::RELAY_PIN, HIGH); to digitalWrite(UI::RELAY_PIN, LOW);
- Run.cpp line 39: void Run::startMill() { digitalWrite(UI::RELAY_PIN, LOW); } to void Run::startMill() { digitalWrite(UI::RELAY_PIN, HIGH); }
- Run.cpp line 41: void Run::stopMill() { digitalWrite(UI::RELAY_PIN, HIGH); } to void Run::stopMill() { digitalWrite(UI::RELAY_PIN, LOW); }
The values for the PINs can be found here demoSetup.md
- depending on i2c or SPI you need to change some values (lines 141 and further). The default values should still work. If not we proably need to update the U8GLib
- if you use i2c, verify if the lines 115 - 123 (SPI - BUS) are comented out.
- display pins do not need to be set, because they are standard. You can take them from the schematic view or the demoSetup.md
- if you use i2c-display, based on this comment you may want to change line 132 to U8GLIB UI::u8g = *new U8GLIB_SSD1306_128X64_2X(U8G_I2C_OPT_FAST);
You may want to change some more settings in UI.h:
- if only 1x MILL_BUTTON: comment out line 36: //#define MILL_BUTTON_2 ...
- if Display is in horizontal orientation: comment out line 47: //#define PORTRAIT_DISPLAY
- if you want a single display page for every mode: uncomment line 52: #define FLAT_MODE
- if you want to erase EEPROM and flash with default values: uncomment line 59: #define RESET_MODE
- if you want to use the scale / HX711 Weight-cell: uncomment line 65: #define SCALE