handlerqq部落24-2

qq部落24-2  时间:2021-01-25  阅读:()
IntroductionTheX-CUBE-MEMS1softwarepackageallowsyoutobuildapplicationsbasedonsensordatafromSTM32NucleodevelopmentplatformsmountingacompatibleX-NUCLEOexpansionboardwithseveralhighperformanceSTmotionMEMSandenvironmentalsensors.
Youcan,however,substituteindividualsensorsontheX-NUCLEOexpansionboardwithsinglesensorboardswithcompatiblepinsforthestandardDIL24socket.
HowtouseasensoronaDIL24socketinX-CUBE-MEMS1packageapplicationsAN5353ApplicationnoteAN5353-Rev1-June2019ForfurtherinformationcontactyourlocalSTMicroelectronicssalesoffice.
www.
st.
com1Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorInthisexample,wereplacetheLSM6DSLsensorontheX-NUCLEO-IKS01A2expansionboardwiththeLSM6DSOsensorconnectedtoaboardwithaDIL24socket.
WehavechosentheDataLogFusionapplication(usingMotionFXsensorfusionalgorithm)runningontheNUCLEO-L476RGdevelopmentboard.
Withminormodifications,youcanfollowthesameprocedureforothersensors,expansionboardsandSTM32Nucleoboardplatformsaswell.
Step1.
Addthesensorintheboardconfigurationheaderfile.
Intheinc/iks01a2_conf.
hfile,disabletheuseoftheLSM6DSLsensorbyinserting"0U"ashighlightedbelowinbold,andenabletheLSM6DSOsensorbyaddingthedefinestatementalsoshownbelowinbold.
#defineUSE_IKS01A2_ENV_SENSOR_HTS221_01U#defineUSE_IKS01A2_ENV_SENSOR_LPS22HB_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM6DSL_00U#defineUSE_IKS01A2_MOTION_SENSOR_LSM303AGR_ACC_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM303AGR_MAG_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM6DSO_01UStep2.
AddthesensordriversinaprojectforaspecificIDE(forexample,SW4STM32)andincludethepathtothesensordriversintotheprojectsettings.
Figure1.
AddLSM6DSOsensordriversinaprojectfortheSW4STM32IDEAN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page2/10Figure2.
AddLSM6DSOsensorincludingpathtoaprojectfortheSW4STM32IDEStep3.
SubstitutethesensorontheX-NUCLEOexpansionboardwiththesinglesensorontheDIL24socketboardintheX-CUBE-MEMS1application.
Step3a.
SubstitutetheLSM6DSLsensorhandlerwiththeLSM6DSOsensorhandlerinthesrc/main.
cfile,main()function(inboldbelow).
/*AcquiredatafromenabledsensorsandfillMsgstream*/RTC_Handler(&msg_dat);Accelero_Sensor_Handler(&msg_dat,IKS01A2_LSM6DSO_0);Gyro_Sensor_Handler(&msg_dat,IKS01A2_LSM6DSO_0);Magneto_Sensor_Handler(&msg_dat,IKS01A2_LSM303AGR_MAG_0);Humidity_Sensor_Handler(&msg_dat,IKS01A2_HTS221_0);Temperature_Sensor_Handler(&msg_dat,IKS01A2_HTS221_0);Pressure_Sensor_Handler(&msg_dat,IKS01A2_LPS22HB_0);Step3b.
SubstitutetheLSM6DSLsensorinitializationwithLSM6DSOinitializationinthesrc/main.
cfile,Init_Sensors()function(inboldbelow).
/***@briefInitializeallsensors*@paramNone*@retvalNone*/staticvoidInit_Sensors(void){(void)IKS01A2_MOTION_SENSOR_Init(IKS01A2_LSM6DSO_0,MOTION_ACCELERO|MOTION_GYRO);(void)IKS01A2_MOTION_SENSOR_Init(IKS01A2_LSM303AGR_MAG_0,MOTION_MAGNETO);(void)IKS01A2_ENV_SENSOR_Init(IKS01A2_HTS221_0,ENV_TEMPERATURE|ENV_HUMIDITY);(void)IKS01A2_ENV_SENSOR_Init(IKS01A2_LPS22HB_0,ENV_PRESSURE);}AN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page3/10Step3c.
AddtheLSM6DSOsensorUnicleoIDfromthetablebelowtothesrc/DemoSerial.
cfile(inboldbelowthetable).
Table1.
Unicleo-GUIsupportedsensorsandIDsAccelerometer/gyroscopeMagnetometerPressure/temperatureHumidity/temperatureNameIDNameIDNameIDNameIDLSM6DS01LIS3MDL1LPS25HB1HTS2211LSM6DS32LSM303AGR_MAG2LPS22HB3STTS7512LSM6DSL3LIS2MDL3LPS22HH4LIS2DH124H3LIS331DL5LSM303AGR6LSM6DSO7LIS2DW128LSM6DSR9LSM6DSOX10#defineLPS25HB_UNICLEO_ID_ONBOARD1#defineLPS25HB_UNICLEO_ID_DIL2#defineLPS22HB_UNICLEO_ID3#defineHTS221_UNICLEO_ID1#defineLSM6DS0_UNICLEO_ID1#defineLSM6DS3_UNICLEO_ID2#defineLSM6DSL_UNICLEO_ID3#defineLSM6DSO_UNICLEO_ID7#defineLIS3MDL_UNICLEO_ID1#defineLSM303AGR_UNICLEO_ID_MAG2Step3d.
SubstituteLSM6DSLsensordisablewithLSM6DSOdisableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_ACCELERO_GYRO_Initcase(inboldbelow).
Serialize_s32(&Msg->Data[3],LSM6DSO_UNICLEO_ID,4);Step3e.
SubstituteLSM6DSLsensorenablewithLSM6DSOenableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_Start_Data_Streamingcase(inboldbelow).
if((SensorsEnabled&ACCELEROMETER_SENSOR)==ACCELEROMETER_SENSOR){(void)IKS01A2_MOTION_SENSOR_Enable(IKS01A2_LSM6DSO_0,MOTION_ACCELERO);}if((SensorsEnabled&GYROSCOPE_SENSOR)==GYROSCOPE_SENSOR){(void)IKS01A2_MOTION_SENSOR_Enable(IKS01A2_LSM6DSO_0,MOTION_GYRO);}Step3f.
SubstituteLSM6DSLsensordisablewithLSM6DSOdisableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_Stop_Data_Streamingcase(inboldbelow).
(void)IKS01A2_MOTION_SENSOR_Disable(IKS01A2_LSM6DSO_0,MOTION_ACCELERO);(void)IKS01A2_MOTION_SENSOR_Disable(IKS01A2_LSM6DSO_0,MOTION_GYRO);Step4.
Changesensororientation(optional).
AN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page4/10IntheMotionFX_Manager.
cfileMotionFX_manager_init()function,checkaccelerometer,gyroscopeandmagnetometersensororientationsetupwithrealDIL24sensororientationandupdateifnecessary.
Inourcase,weneedtocheckaccelerometerandgyroscopesensororientationsetupwithLSM6DSO(DIL24module)orientation(inboldbelow).
/***@briefInitialisesMotionFXalgorithm*@paramNone*@retvalNone*/voidMotionFX_manager_init(void){characc_orientation[4];chargyro_orientation[4];charmag_orientation[4];acc_orientation[0]='n';acc_orientation[1]='w';acc_orientation[2]='u';gyro_orientation[0]='n';gyro_orientation[1]='w';gyro_orientation[2]='u';mag_orientation[0]='n';mag_orientation[1]='e';mag_orientation[2]='u';Note:Inthisexample,nochangeisneededastheLSM6DSLsensorontheX-NUCLEOexpansionboardandtheLSM6DSOsensorontheDIL24modulehavethesameorientation.
Step5.
BuildtheapplicationandruntheUnicleo-GUISWtocheckiftheLSM6DSOsensorisactiveandtheMotionSensorFusionalgorithmisworkingproperly.
Figure3.
RunningDataLogFusionapplicationwithLSM6DSOsensor(DIL24module)inUnicleo-GUISWRELATEDLINKSSTEVAL-MKI196V1evaluationboardLSM6DSOdatasheetfreelyavailableatwww.
st.
comAN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page5/10LSM6DSOapplicationnote:AN5192,"LSM6DSO:always-on3Daccelerometerand3Dgyroscope",freelyavailableatwww.
st.
comRevisionhistoryTable2.
DocumentrevisionhistoryDateRevisionChanges11-Jun-20191InitialreleaseAN5353AN5353-Rev1page6/10Contents1Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensor.
2Revisionhistory6AN5353ContentsAN5353-Rev1page7/10ListoffiguresFigure1.
AddLSM6DSOsensordriversinaprojectfortheSW4STM32IDE2Figure2.
AddLSM6DSOsensorincludingpathtoaprojectfortheSW4STM32IDE3Figure3.
RunningDataLogFusionapplicationwithLSM6DSOsensor(DIL24module)inUnicleo-GUISW5AN5353ListoffiguresAN5353-Rev1page8/10ListoftablesTable1.
Unicleo-GUIsupportedsensorsandIDs4Table2.
Documentrevisionhistory6AN5353ListoftablesAN5353-Rev1page9/10IMPORTANTNOTICE–PLEASEREADCAREFULLYSTMicroelectronicsNVanditssubsidiaries("ST")reservetherighttomakechanges,corrections,enhancements,modifications,andimprovementstoSTproductsand/ortothisdocumentatanytimewithoutnotice.
PurchasersshouldobtainthelatestrelevantinformationonSTproductsbeforeplacingorders.
STproductsaresoldpursuanttoST'stermsandconditionsofsaleinplaceatthetimeoforderacknowledgement.
Purchasersaresolelyresponsibleforthechoice,selection,anduseofSTproductsandSTassumesnoliabilityforapplicationassistanceorthedesignofPurchasers'products.
Nolicense,expressorimplied,toanyintellectualpropertyrightisgrantedbySTherein.
ResaleofSTproductswithprovisionsdifferentfromtheinformationsetforthhereinshallvoidanywarrantygrantedbySTforsuchproduct.
STandtheSTlogoaretrademarksofST.
ForadditionalinformationaboutSTtrademarks,pleaserefertowww.
st.
com/trademarks.
Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.
Informationinthisdocumentsupersedesandreplacesinformationpreviouslysuppliedinanypriorversionsofthisdocument.
2019STMicroelectronics–AllrightsreservedAN5353AN5353-Rev1page10/10

CloudCone(1.99美元),可以额外选择Voxility高防IP

CloudCone 商家也是比较有特点的,和我们熟悉的DO、Vultr、Linode商家均是可以随时删除机器开通的小时计费模式。这个对于有需要短租服务器的来说是比较有性价比的。但是,他们还有一个缺点就是机房比较少,不同于上面几个小时计费服务商可以有多机房可选,如果有这个多机房方案的话,应该更有特点。这次我们可以看到CloudCone闪购活动提供洛杉矶三个促销方案,低至月付1.99美元。商家也可以随...

Megalayer美国独立服务器新用户首月优惠350元(30M优化不限流量)

Megalayer 商家在开始看到有提供香港服务器、香港站群服务器的时候有介绍过,后来就一直没有怎么关注。但是前几天有看到网友使用到他们家的美国独立服务器问其如何的,但是我没有使用过就不好评论,这不前几天也有介绍到Megalayer美国独立服务器。以及我们也有看到商家有提供美国站群服务器和美国大带宽服务器产品,可选30M不限制流量CN2优化线路,以及100M不限制流量国际带宽线路。新年元旦后,Me...

Pia云服务香港月20元游戏提供香港CN2云服务器

Pia云商家在前面有介绍过一次,根据市面上的信息是2018的开办的国人商家,原名叫哔哔云,目前整合到了魔方云平台。这个云服务商家主要销售云服务器VPS主机业务和服务,云服务器采用KVM虚拟架构 。目前涉及的机房有美国洛杉矶、中国香港和深圳地区。洛杉矶为crea机房,三网回程CN2 GIA,自带20G防御。中国香港机房的线路也是CN2直连大陆,比较适合建站或者有游戏业务需求的用户群。在这篇文章中,简...

qq部落24-2为你推荐
名侦探柯南644名侦探柯南中有铃木园子出现的是哪几集?输入法哪个好用手机输入法哪个好?帕萨特和迈腾哪个好迈腾与帕萨特那个好?江门旅游景点哪个好玩的地方江门有什么地方好玩的?唱K 行街 免答少儿英语哪个好少儿英语哪个好游戏加速器哪个好网游加速器哪个最好用?核芯显卡与独立显卡哪个好独立显卡和核心显卡哪个好核芯显卡与独立显卡哪个好核心显卡和独立显卡哪个好看书软件哪个好读书软件哪个好清理手机垃圾软件哪个好清理手机垃圾的软件哪个好
百度域名 个人域名注册 深圳域名空间 域名解析服务器 3322免费域名 美元争夺战 gitcafe 毫秒英文 工作站服务器 赞助 流量计费 100mbps 空间首页登陆 免费外链相册 免费asp空间 网页加速 学生机 腾讯云平台 防盗链 香港打折信息 更多