Nod ring

Hello,

i have to steer a modellcar with a Nod ring for a project in my college. Therefore i have to transfer the Euler angels from this Visual Studio 2015 programm to the Arduino IDE.

#include "stdafx.h"
#include "NodPlugin.h"
#include "windows.h"

#pragma comment(lib, "OpenSpatialDll.lib")

void eventFired(NodEvent ev)
{

if (ev.type == EventType::ServiceReady)
{
if (NodNumRings() > 0)
{
NodSubscribe(Modality::EulerMode, NodGetRingName(0));
}
}

// Euler-Winkel
else if (ev.type == EventType::EulerAngles)
{
printf("\nEuler Angle Fired, roll: %f, pitch: %f", ev.roll, ev.pitch);
}
}

int main()
{
NodInitialize(eventFired);
while (true)
{
}

}

But there is this problem:

Arduino: 1.6.3 (Windows 8.1), Platine: "Arduino Uno"

In file included from C:\Users\Alexander\Desktop\Arduino\libraries\NODRING/stdafx.h:8:0,

from sketch_nov28a.ino:1:

C:\Users\Alexander\Desktop\Arduino\libraries\NODRING/targetver.h:8:23: fatal error: SDKDDKVer.h: No such file or directory

#include <SDKDDKVer.h>

^

compilation terminated.

Fehler beim Kompilieren.

There is no SDKDDKVer.h library in the libraries.

How can i transfer the Euler Angles to my Arduino IDE?

Thank you for helping

Alex

Welcome to the Forum. Please read Nick Gammon's two posts at the top of the Forum for guidelines on using and posting code on the Forum, especially the use of code tags for code listings. You'll get better/more responses if you do.

Ok thank you here is the code again:

#include "stdafx.h"
#include "NodPlugin.h"
#include "windows.h"

#pragma comment(lib, "OpenSpatialDll.lib")

void eventFired(NodEvent ev)
{

	if (ev.type == EventType::ServiceReady)
	{
		if (NodNumRings() > 0)
		{
			NodSubscribe(Modality::EulerMode, NodGetRingName(0));
		}
	}

	// Euler-Winkel
	else if (ev.type == EventType::EulerAngles)
	{
		printf("\nEuler Angle Fired, roll: %f, pitch: %f", ev.roll, ev.pitch);
	}
}





	int main()
	{
		NodInitialize(eventFired);
		while (true)
		{
		}
	
	}

Ok thank you here is the code again:

That is not the code that runs on the Arduino.

Right that is my question how can i change it one. Why does this error appears?

SDKDDKVer.h: No such file or directory

The very first line of your program includes a file which includes a file which tries to include SDKDKver.h. That looks like it might be a standard part of visual studio, to run on a PC.

You need to remove that #include from targetver.h and then work out which functions it was using from that library. If you are lucky, it is a function that you don't need and you can delete it.

If it is a function necessary for what you are trying to do then you need to rewrite it for the Arduino.

Right that is my question

What is?

how can i change it one.

Highlight all the code. Press the 1.

Delta_G:
Well you obviously either don't have that library or have it in the wrong place.

Thank you. I added all the libraries. Now this error appears :frowning:

Compiling 'NodRingArduino2' for 'Arduino Uno'
minwindef.h:In file included from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
winnt.h:147:2: error: #error "No Target Architecture"
:#error "No Target Architecture"
minwindef.h:In file included from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
winnt.h:938:2: error: #error Must define a target architecture
:#error Must define a target architecture
winscard.h:In file included from
windows.h:from
NodRingArduino2.ino:from
wtypes.h:742:26: error: pasting "" and "" does not give a valid preprocessing token
:#define _VARIANT_BOOL ##
oaidl.h:in expansion of macro '_VARIANT_BOOL
:_VARIANT_BOOL bool
wtypes.h:742:26: error: pasting "" and "" does not give a valid preprocessing token
:#define _VARIANT_BOOL ##
oaidl.h:in expansion of macro '_VARIANT_BOOL
:_VARIANT_BOOL *pbool
vcruntime.h:In file included from
stdint.h:from
inttypes.h:from
stdio.h:from
stdafx.h:from
NodRingArduino2.ino:from
vadefs.h:137:49: error: template argument 1 is invalid
:struct __vcrt_va_list_is_reference<_Ty&&>
stdint.h:In file included from
inttypes.h:from
stdio.h:from
stdafx.h:from
NodRingArduino2.ino:from
vcruntime.h:81:1: error: expected constructor, destructor, or type conversion before '(' token
:_CRT_BEGIN_C_HEADER
winnt.h:In file included from
minwindef.h:from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
pshpack4.h:31:16: error: expected declaration before end of line
:#pragma pack(4)
Error compiling project sources

Is there another way to use the values from Visual Studio with Arduino. I think the Nod ring only works with Visual Studio 2015.

Is there another way to use the values from Visual Studio with Arduino.

Visual Studio is an application development environment. Your question makes no sense. Visual Studio does not connect to a serial port and send or receive data from the port.

You can use Visual Studio, and a number of languages. to build an application that CAN connect to a serial port and send or receive data from the port.

So, YOUR application, about which we know nothing, might be able to communicate with the Arduino. Stop asking questions about what Visual Studio can do. As far as the Arduino is concerned, it as useful as Paint.

Ok now i know that.

Does somebody know what that error means?

Alex56:
Compiling 'NodRingArduino2' for 'Arduino Uno'
minwindef.h:In file included from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
winnt.h:147:2: error: #error "No Target Architecture"
:#error "No Target Architecture"
minwindef.h:In file included from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
winnt.h:938:2: error: #error Must define a target architecture
:#error Must define a target architecture
winscard.h:In file included from
windows.h:from
NodRingArduino2.ino:from
wtypes.h:742:26: error: pasting "" and "" does not give a valid preprocessing token
:#define _VARIANT_BOOL ##
oaidl.h:in expansion of macro '_VARIANT_BOOL
:_VARIANT_BOOL bool
wtypes.h:742:26: error: pasting "" and "" does not give a valid preprocessing token
:#define _VARIANT_BOOL ##
oaidl.h:in expansion of macro '_VARIANT_BOOL
:_VARIANT_BOOL *pbool
vcruntime.h:In file included from
stdint.h:from
inttypes.h:from
stdio.h:from
stdafx.h:from
NodRingArduino2.ino:from
vadefs.h:137:49: error: template argument 1 is invalid
:struct __vcrt_va_list_is_reference<_Ty&&>
stdint.h:In file included from
inttypes.h:from
stdio.h:from
stdafx.h:from
NodRingArduino2.ino:from
vcruntime.h:81:1: error: expected constructor, destructor, or type conversion before '(' token
:_CRT_BEGIN_C_HEADER
winnt.h:In file included from
minwindef.h:from
windef.h:from
windows.h:from
NodRingArduino2.ino:from
pshpack4.h:31:16: error: expected declaration before end of line
:#pragma pack(4)
Error compiling project sources

It looks like you're trying to compile a Windows program. That obviously won't work on an Arduino.

You need to extract the useful part of the program and put that into an Arduino program. At this point we don't know what's useful because we don't know much about your project.

Start small. Can you get your bluetooth shield to pair with the Nod ring? Can you see any data coming from it?

I'm pretty sure that one of the MPU6050 libraries incorporates Euler's formula and outputs Euler angles, if that helps. (Might take a bit of searching.)

winnt.h:147:2: error: #error "No Target Architecture"

On an Arduino? Dream on.

Alex56:
Right that is my question how can i change it one. Why does this error appears?
SDKDDKVer.h: No such file or directory

Dude, this is like a pilot asking why a car doesn't have a "extend flaps" lever for take-off. Car is not a plane, even though they do similar things.

The code will not work. What you will have to do is write some new code that does the same thing as the old, perhaps using the old as a general guide in spots where it makes sense.

Hi,

Hi, what is your electronics, programming, arduino, hardware experience?
Is this a school/college/university project, where are your tutors and lecturers.

Thanks.....Tom.... :slight_smile: