Skip to content

Configuration Setup

Bryson Goto edited this page Mar 12, 2020 · 2 revisions

Setting up the Config.h File

If you have not already done so, read about the what the Configuration is here to understand what you are setting up and where to find any information for your specific Arduino setup.

If you are working with a Loom example and a config.h file is provided, but you need to edit it for your sensors, go to Step #7 down below. Step #7 begins by explaining and showing what the format of the config.h should look like.

If you are not provided a config.h file and have your own project code, start from Step #1 from down below.

Step #1.

First, open a file to write the code for your project. Once you open and make your project like below, save the file.

3

Step #2.

When you save it, it will automatically generate a folder for the project like below.

4

Step #3.

Once you save the project, go find the folder location. In this case, it will be in the desktop/loRaPractice/My_Project folder. Once you go to the folder where you saved your project, right-click and select New, then Text Document as to below.

5

Step #4.

Once you made the text document, open the text document. Then go to File and Save As.

6

Step #5.

Once you click Save As..., Rename the file name as config.h and click save

7

Step #6.

Close your Project and the text document and reopen the project only.

  • If you want, you may delete the New Text Document file because we don’t need it.

Step #7.

Close your Project and the text document and reopen the project only. If you want, you may delete the New Text Document file because we don’t need it.

  • The config is split up into two sections: general and components.
  • The general section is the collection of components you’ll be using. Components is the individual electronics that you’ll be using
    • A list of supported hardware can be found here.

8

Step #8.

The syntax of the config is very specific so be careful when you add to it. Here’s a list of general requirements for the syntax:

  1. Each line must end with a backslash “\”
  2. Each set of parentheses, brackets, curly brackets, and single and double quotes must have a beginning and end
  3. For lists within parentheses, each line must have a comma before the backslash except the last line
  4. For each component, there must be a comma between the ending parentheses and backslash except the last component
  5. For lists within brackets, each parameter is separated by a comma
  6. Numbers do not have commas within them (ex. 1000 instead of 1,000)

Step #9.

Each component has a name and a parameter. If you aren’t sure about the types of parameters available, you can type in ‘default’ and the program will automatically assign the sensor values. If you want to change them and are unsure where to find the information for the parameters, refer to here. When you have found your parameters, enter your values you want changed to instead of 'default' in your config.h file