3184 views|12 replies

13

Posts

0

Resources
The OP
 

X-NUCLEO-IKS01A3 driver for Arduino [Copy link]

 
 

Well, I participated in an event and was given a board for free, but the prerequisite was to debug and port it to an MCU, so I wrote the Arduino UNO. Then after I got it, I found that ST actually wrote the STM32duino library here
[https://github.com/stm32duino/X-NUCLEO-IKS01A3](https://github.com/stm32duino/X-NUCLEO-IKS01A3)
and the technical manual is here
[https://www.st.com/content/ccc/resource/technical/document/user_manual/group1/22/ae/90/6d/9f/03/4e/45/DM006 01501/files/DM00601501.pdf/jcr:content/translations/en.DM00601501.pdf](https://www.st.com/content/ccc/resource/technical/document/user_manual/group1/22/ae/90/6d/9f/03/4e/45/DM00601501/files/DM00601501 .pdf/jcr:content/translations/en.DM00601501.pdf)

But there is a problem that this library cannot be used directly after getting it. . .
I will write down how to use this library. .
First, download this library and put it under the Arduino library. When you open the example, you will find that various files cannot be found. Then you need to put back the libraries listed on GitHub.

Then open hello world, the first problem is that float_t is undefined

Open the file and add this definition.

Then there are two errors
[attach] 423579 [/attach]
The first one is that the description file of HTS221 says that it does not support avr, but only supports stm32. I tried it and it can run directly. If you want to solve it, open this here [attach] 423580 [/attach]

Add avr

to the last line

Another way is to compare uint and int, just add a type conversion in front of it





This content is originally created by EEWORLD forum user jianshan . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source


This will compile fine.

However, when I tested it, there was no output at first. Later, I wrote an i2c_scanner and scanned it, and it worked again. I’m not sure why... I found that a code I wrote had a similar problem because I didn’t write i2c.begin(); it worked fine after adding it, but when I looked back at the sample code, it seemed to be there. I don’t know what’s going on...

5.png (15.54 KB, downloads: 0)

5.png

6.png (25.01 KB, downloads: 0)

6.png

8.png (76.44 KB, downloads: 0)

8.png

Latest reply

Yes, all packaged into C++;   Details Published on 2019-7-27 22:32
 

13

Posts

0

Resources
2
 

Um... Does anyone know how to send attachments?

Comments

nmg
[attachimg]423608[/attachimg]  Details Published on 2019-7-21 15:27
 
 

5213

Posts

239

Resources
3
 
jianshan posted on 2019-7-20 20:19 Um... Does anyone know how to send attachments...

Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

Um... Where can I edit an article that has already been posted? I want to add an attachment but I can't find it.  Details Published on 2019-8-3 21:02
 
 
 

1w

Posts

25

Resources
4
 

There is no output at first, it is likely that the contact of the Arduino interface is not good.

Comments

Arduio has direct examples and CPP functions, which are very well written, but difficult to understand.  Details Published on 2019-7-25 16:22
 
 
 

13

Posts

0

Resources
5
 
 
 

13

Posts

0

Resources
6
 
dcexpert posted on 2019-7-21 22:33 There was no output at first, it is likely that the contact of the Arduino interface is not good.

Well, since the flashing is OK, I think this is not the problem.

 
 
 

1700

Posts

4

Resources
7
 
dcexpert posted on 2019-7-21 22:33 There was no output at first, it is likely that the contact of the Arduino interface is not good.

Arduio has direct examples and CPP functions, which are very well written, but difficult to understand.

Comments

The advantage of Arduino is that it is easy to copy and use, the disadvantage is that it is difficult to improve and debug.  Details Published on 2019-7-25 16:34
 
 
 

1w

Posts

25

Resources
8
 
DavidZH posted on 2019-7-25 16:22 Arduio has direct examples and CPP functions, which are very well written, but difficult to understand.

The advantage of Arduino is that it is easy to copy and use, the disadvantage is that it is difficult to improve and debug.

Comments

Yes, all packaged into C++;  Details Published on 2019-7-27 22:32
 
 
 

1700

Posts

4

Resources
9
 
dcexpert posted on 2019-7-25 16:34 The advantage of Arduino is that it is easy to copy and use, but the disadvantage is that it is difficult to improve and debug.

Yes, all packaged into C++;

 
 
 

13

Posts

0

Resources
10
 

Well, I personally think the encapsulation is OK. You can basically use it after looking at the example.

Enable it in setup, and get it when you want to use it

 
 
 

13

Posts

0

Resources
11
 

Um... Where can I edit an article that has already been posted? I want to add an attachment but I can't find it.

 
 
 

13

Posts

0

Resources
12
 

Link: https://pan.baidu.com/s/1zBLOK8bQrOOkoH77CaEs4Q Extraction code: grcy

 
 
 

13

Posts

0

Resources
13
 
I really can't find where to upload the file... I uploaded the file to Baidu Cloud, the link is on the 11th floor...
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list