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

麻花云-香港CN2云服务器,安徽BGP线路,安徽移动大带宽!全系6折!

一、麻花云官网点击直达麻花云官方网站二、活动方案优惠码:专属优惠码:F1B07B 享受85折优惠。点击访问活动链接最新活动 :五一狂欢 惠战到底 香港云主机 1.9折起香港特价体验云主机CN2 云服务器最新上线KVM架构,,默认40G SSD,+10G自带一个IPv4,免费10Gbps防御,CPU内存带宽价格购买1核1G1M19元首月链接2核2G 2M92元/3个月链接2核4G3M112元/3个月...

2021年国内/国外便宜VPS主机/云服务器商家推荐整理

2021年各大云服务商竞争尤为激烈,因为云服务商家的竞争我们可以选择更加便宜的VPS或云服务器,这样成本更低,选择空间更大。但是,如果我们是建站用途或者是稳定项目的,不要太过于追求便宜VPS或便宜云服务器,更需要追求稳定和服务。不同的商家有不同的特点,而且任何商家和线路不可能一直稳定,我们需要做的就是定期观察和数据定期备份。下面,请跟云服务器网(yuntue.com)小编来看一下2021年国内/国...

iON Cloud:新加坡cn2 gia vps/1核/2G内存/25G SSD/250G流量/10M带宽,$35/月

iON Cloud怎么样?iON Cloud升级了新加坡CN2 VPS的带宽和流量最低配的原先带宽5M现在升级为10M,流量也从原先的150G升级为250G。注意,流量也仅计算出站方向。iON Cloud是Krypt旗下的云服务器品牌,成立于2019年,是美国老牌机房(1998~)krypt旗下的VPS云服务器品牌,主打国外VPS云服务器业务,均采用KVM架构,整体性能配置较高,云服务器产品质量靠...

qq部落24-2为你推荐
天气预报哪个好用哪个最准确手机上的天气预报软件,哪个最准,最好用?录屏软件哪个好手机录屏的话那个软件会好一点985和211哪个好985和211哪个强?具体分析点。录音软件哪个好录音软件哪个好绝地求生加速器哪个好绝地求生的加速器哪个好用?等额本息等额本金哪个好等额本息和等额本金哪个好?无纺布和熔喷布口罩哪个好表层水刺布,中间层pp无纺布+熔喷布,里层pp无纺布口罩好吗?核芯显卡与独立显卡哪个好英特尔核芯显卡怎么样?和独立显卡那个更好?电陶炉和电磁炉哪个好电磁炉与电陶炉有啥区别,哪个更好些?qq空间登录qq空间如何登陆
安徽双线服务器租用 域名备案流程 网盘申请 本网站在美国维护 韩国名字大全 服务器维护方案 idc是什么 太原网通测速平台 网通服务器托管 吉林铁通 双线机房 网通服务器 我的世界服务器ip 西安主机 免费asp空间申请 测速电信 腾讯网盘 移动王卡 蓝队云 windows2008 更多