Author Topic: Getting started  (Read 2716 times)

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Getting started
« on: March 20, 2019, 09:28:02 »
Hi there,
I'm interested in getting started in using Tinkerforge.
What's a good simple system to start with and to be programmed in C++?
Any advice?
Thanks,
Erik

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.136
    • View Profile
Re: Getting started
« Reply #1 on: March 20, 2019, 09:37:08 »
Do you have any idea for a project or specific interest?

Something easy to start with is always the weather stations. You can start with calling getters to get the measurements from the sensors and print then to the console. From there you can go anywhere (store data in a database, draw graphs, etc).
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting started
« Reply #2 on: March 20, 2019, 15:10:53 »
thanks borg,
I would like to start with a very simple application programmed in C++ and using the Tinkerforge Hardware and Software.
What are the requirements in terms of Hardware and Software?

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.136
    • View Profile
Re: Getting started
« Reply #3 on: March 20, 2019, 16:50:21 »
In terms of software you need to download the Brick Daemon, Brick Viewer and C API Bindings. You can get all of them here: https://www.tinkerforge.com/en/doc/Downloads.html

To get started with the C Bindings you can take a look here: https://www.tinkerforge.com/en/doc/Software/API_Bindings_C.html

In terms of hardware it obviously depends what you want to do. The absolute minimum that does something useful and is easy to understand would probably be a Master Brick together with a Temperature Bricklet 2.0.

Hardware wise you need:

* Mini USB cable
* Master Brick
* Bricklet cable (7p-10p)
* Temperature Bricklet 2.0

Master Brick: https://www.tinkerforge.com/en/shop/bricks/master-brick.html
Temperature Bricklet 2.0: https://www.tinkerforge.com/en/shop/bricklets/sensors/temperature-v2-bricklet.html

You can pick the suitable cables as options in the shop.

To get started, you connect the Bricklet to the Brick with the Bricklet cable and the Brick to your PC with the USB cable. Now you can view the temperature in Brick Viewer and use the C Bindings to read out the temperature in C++.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting started
« Reply #4 on: March 21, 2019, 11:47:10 »
Thanks borg,
I'll have a look at these items.
If we would like to integrate also a Wi-fi module on this system, what would be the extra requirements?
Kind regards,

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.136
    • View Profile
Re: Getting started
« Reply #5 on: March 21, 2019, 12:30:33 »
You need an additional WIFI Extension 2.0 and a USB Power Supply.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting started
« Reply #6 on: March 28, 2019, 15:48:46 »
Hi borg,

thanks for the feedback.
I got the parts and connected them together.

In the Brick viewer I can see the live Temperature evolution over the time.

I'm new to C++, how can I use the binding functions that you mentioned?
Do I have to use the Makefile?
I can compile the code but there's an error when I try to link (build) it.

thanks in advance,
Erik

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.136
    • View Profile
Re: Getting started
« Reply #7 on: March 28, 2019, 15:51:41 »
You don't have to use a Makefile.

Which operating system and which compiler/IDE do you use?
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting started
« Reply #8 on: March 28, 2019, 16:06:09 »
OS: Windows 7 - 64 bit
IDE: Geany 1.34.1 (compiler GCC version 7.3.0)

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.136
    • View Profile
Re: Getting started
« Reply #9 on: March 28, 2019, 16:12:48 »
On Windows with GCC you can use the command line to compile one of the examples, see here: https://www.tinkerforge.com/en/doc/Software/API_Bindings_C.html#gcc

Don't forget to change the UID placeholder in the example to the UID of your Bricklet.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

eccornelsen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting started
« Reply #10 on: March 29, 2019, 09:34:55 »
thanks borg,

I followed the instructions that you suggested and it's working now.
I've created a project folder with the files below:
1) example_project/
 -> ip_connection.cpp
 -> ip_connection.h
 -> brick_master.cpp
 -> brick_master.h
 -> bricklet_temperature_v2.cpp
 -> bricklet_temperature_v2.h
 -> example_callback.cpp

2) update #define UID with the UIDs from the brick and the bricklet.

3) from cmd:
gcc -o example.exe *.cpp -lws2_32 -ladvapi32

Any ideas on the next steps?

kind regards,
Erik