Skip to content

A node-red flow to exercise the MPU-6050 from the Raspberry Pi

License

Notifications You must be signed in to change notification settings

cmayor314/RPi-mpu6050.flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

RPi-mpu6050.flow

A node-red flow to exercise the MPU-6050 from the Raspberry Pi. Requires I2C.

[{"id":"3fe799fe.c01866","type":"subflow","name":"Get Current Operational Mode Status HMC5883L","info":"","category":"","in":[{"x":40,"y":80,"wires":[{"id":"da3befc1.25c41"}]}],"out":[{"x":820,"y":80,"wires":[{"id":"b8297bc5.47d688","port":0}]}],"env":[],"color":"#E9967A","icon":"node-red/watch.svg"},{"id":"da3befc1.25c41","type":"function","z":"3fe799fe.c01866","name":"read mode","func":"return {command:"02"};","outputs":1,"noerr":0,"x":190,"y":80,"wires":[["f01002ac.0ff"]],"outputLabels":["get ID1"]},{"id":"f01002ac.0ff","type":"i2c in","z":"3fe799fe.c01866","name":"HMC5883L command","address":"30","command":"","count":"1","x":410,"y":80,"wires":[["b8297bc5.47d688"]]},{"id":"b8297bc5.47d688","type":"function","z":"3fe799fe.c01866","name":"interpret mode","func":"var mystring = "";\nswitch (0x03 & msg.payload)\n{\n case 0x00: mystring = "Continuous-Measurement Mode"; break;\n case 0x01: mystring = "Single-Measurement Mode (Default)"; break;\n case 0x02: mystring = "Idle Mode (0b10)"; break;\n case 0x03: mystring = "Idle Mode (0b11)"; break;\n default: mystring = "Mystery/Broken Device Mode"\n}\nmsg.Mode = mystring;\nnode.status({text:"Mode: "+mystring});\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":80,"wires":[[]]},{"id":"338b2bd0.cc74d4","type":"subflow","name":"Get Compass Reading HMC5883L","info":"","category":"","in":[{"x":40,"y":160,"wires":[{"id":"7926fcc6.86d904"}]}],"out":[{"x":2040,"y":220,"wires":[{"id":"e0cf7f15.1f308","port":0}]}],"env":[],"color":"#E9967A","inputLabels":["trigger request"],"outputLabels":["Rich packet (X,Y,Z, etc)"],"icon":"font-awesome/fa-cubes"},{"id":"fe33bb1f.01cc48","type":"comment","z":"338b2bd0.cc74d4","name":"Now: slight timing delay","info":"Was: hope the multi-part msgs arrive in order i guess","x":410,"y":120,"wires":[]},{"id":"e85bde50.17a42","type":"inject","z":"338b2bd0.cc74d4","name":"X - HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":80,"wires":[["ca904d86.356fb"]]},{"id":"ca904d86.356fb","type":"function","z":"338b2bd0.cc74d4","name":"read X command","func":"return [{command:"03"},{command:"04"}];","outputs":2,"noerr":0,"x":660,"y":160,"wires":[["a9cca95e.563358"],["a9cca95e.563358"]],"outputLabels":["get ID1","get ID2"]},{"id":"a9cca95e.563358","type":"i2c in","z":"338b2bd0.cc74d4","name":"HMC5883L command","address":"30","command":"","count":"1","x":910,"y":160,"wires":[["f5628349.0a9d8"]]},{"id":"f5628349.0a9d8","type":"join","z":"338b2bd0.cc74d4","name":"join msgs","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1110,"y":160,"wires":[["6ad2487b.952db8"]]},{"id":"6ad2487b.952db8","type":"function","z":"338b2bd0.cc74d4","name":"calc X","func":"//16-bit 2's complement nonsense\nvar X = (msg.payload[0]<<8)+(msg.payload[1]);\nif ((X & 0x8000) > 0) {\n X = X - 0x10000;\n}\n\nmsg.label = "Xmag";\nmsg.payload = (X/1090).toFixed(3); //msg.X in gauss?\nnode.status({text:"X: "+msg.payload});\n\nreturn msg;","outputs":1,"noerr":2,"x":1250,"y":160,"wires":[["c33df8e7.3cc208","77379d3b.88c864"]]},{"id":"95be3482.6a41c8","type":"inject","z":"338b2bd0.cc74d4","name":"Z - HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":220,"wires":[["6907d235.96f82c"]]},{"id":"6907d235.96f82c","type":"function","z":"338b2bd0.cc74d4","name":"read Z command","func":"return [{command:"05"},{command:"05"}];","outputs":2,"noerr":0,"x":660,"y":220,"wires":[["3434255b.cbcbda"],["3434255b.cbcbda"]],"outputLabels":["get ID1","get ID2"]},{"id":"3434255b.cbcbda","type":"i2c in","z":"338b2bd0.cc74d4","name":"HMC5883L command","address":"30","command":"","count":"1","x":910,"y":220,"wires":[["a0921bd1.5f6de8"]]},{"id":"c33df8e7.3cc208","type":"debug","z":"338b2bd0.cc74d4","name":"msg","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1410,"y":160,"wires":[]},{"id":"a0921bd1.5f6de8","type":"join","z":"338b2bd0.cc74d4","name":"join msgs","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1110,"y":220,"wires":[["20728521.df8d7a"]]},{"id":"20728521.df8d7a","type":"function","z":"338b2bd0.cc74d4","name":"calc Z","func":"//16-bit 2's complement nonsense\nvar X = (msg.payload[0]<<8)+(msg.payload[1]);\nif ((X & 0x8000) > 0) {\n X = X - 0x10000;\n}\n\nmsg.label = "Zmag";\nmsg.payload = (X/1090).toFixed(3); //msg.X in gauss?\nnode.status({text:"Z: "+msg.payload});\n\nreturn msg;","outputs":1,"noerr":2,"x":1250,"y":220,"wires":[["c33df8e7.3cc208","77379d3b.88c864"]]},{"id":"49293a3a.b6d6c4","type":"inject","z":"338b2bd0.cc74d4","name":"Y - HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":320,"wires":[["ae8bcce3.51743"]]},{"id":"ae8bcce3.51743","type":"function","z":"338b2bd0.cc74d4","name":"read Y command","func":"return [{command:"07"},{command:"08"}];","outputs":2,"noerr":0,"x":660,"y":280,"wires":[["15dad9f3.ea2526"],["15dad9f3.ea2526"]],"outputLabels":["get ID1","get ID2"]},{"id":"15dad9f3.ea2526","type":"i2c in","z":"338b2bd0.cc74d4","name":"HMC5883L command","address":"30","command":"","count":"1","x":910,"y":280,"wires":[["2fb1883e.d04e78"]]},{"id":"2fb1883e.d04e78","type":"join","z":"338b2bd0.cc74d4","name":"join msgs","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1110,"y":280,"wires":[["ea113c60.15eec"]]},{"id":"ea113c60.15eec","type":"function","z":"338b2bd0.cc74d4","name":"calc Y","func":"//16-bit 2's complement nonsense\nvar X = (msg.payload[0]<<8)+(msg.payload[1]);\nif ((X & 0x8000) > 0) {\n X = X - 0x10000;\n}\n\nmsg.label = "Ymag";\nmsg.payload = (X/1090).toFixed(3); //msg.X in gauss?\nnode.status({text:"Y: "+msg.payload});\n\nreturn msg;","outputs":1,"noerr":2,"x":1250,"y":280,"wires":[["c33df8e7.3cc208","77379d3b.88c864"]]},{"id":"77379d3b.88c864","type":"join","z":"338b2bd0.cc74d4","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"label","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1430,"y":220,"wires":[["b26250d0.4d9db"]]},{"id":"b26250d0.4d9db","type":"change","z":"338b2bd0.cc74d4","name":"set/delete props","rules":[{"t":"delete","p":"command","pt":"msg"},{"t":"delete","p":"size","pt":"msg"},{"t":"set","p":"label","pt":"msg","to":"xyz mag","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"label","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1610,"y":220,"wires":[["e0cf7f15.1f308"]]},{"id":"93694253.6c96c","type":"comment","z":"338b2bd0.cc74d4","name":"XYZ magnetic field output","info":"","x":1750,"y":180,"wires":[]},{"id":"a4d6b2ac.5b295","type":"delay","z":"338b2bd0.cc74d4","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":180,"wires":[["6907d235.96f82c"]]},{"id":"464e0f3.fb9b1f","type":"delay","z":"338b2bd0.cc74d4","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":280,"wires":[["ae8bcce3.51743"]]},{"id":"e0cf7f15.1f308","type":"function","z":"338b2bd0.cc74d4","name":"calculate abs magnitude","func":"msg.payload.ABSMAG = (Math.sqrt(msg.payload.Xmagmsg.payload.Xmag+msg.payload.Ymagmsg.payload.Ymag+msg.payload.Zmag*msg.payload.Zmag).toFixed(3));\nmsg.payload.UNITS = "Gauss";\nmsg.payload.tinyunits = "G";\nreturn msg;","outputs":1,"noerr":2,"x":1840,"y":220,"wires":[[]]},{"id":"7926fcc6.86d904","type":"function","z":"338b2bd0.cc74d4","name":"input trigger","func":"\nreturn msg;","outputs":1,"noerr":2,"x":200,"y":160,"wires":[["ca904d86.356fb","a4d6b2ac.5b295","464e0f3.fb9b1f"]]},{"id":"a0533138.5facd","type":"subflow","name":"Read Status Register HMC5883L","info":"","category":"","in":[{"x":40,"y":80,"wires":[{"id":"acdfa42.f532058"}]}],"out":[{"x":820,"y":80,"wires":[{"id":"dc0ee6e6.23f118","port":0}]}],"env":[],"color":"#E9967A","inputLabels":["msg trigger"],"outputLabels":["Rich msg packet"],"icon":"node-red/comment.svg"},{"id":"acdfa42.f532058","type":"function","z":"a0533138.5facd","name":"read status","func":"return {command:"09"};","outputs":1,"noerr":0,"x":190,"y":80,"wires":[["c576ce39.3a893"]],"outputLabels":["get ID1"]},{"id":"c576ce39.3a893","type":"i2c in","z":"a0533138.5facd","name":"HMC5883L command","address":"30","command":"","count":"1","x":410,"y":80,"wires":[["dc0ee6e6.23f118"]]},{"id":"dc0ee6e6.23f118","type":"function","z":"a0533138.5facd","name":"interpret status","func":"msg.rdy = (0x1 & msg.payload);\nmsg.lock = ((0x10 & msg.payload)>>1);\n\nmsg.topic = "Status register";\nnode.status({text:"Status: RDY:"+msg.rdy+" LCK:"+msg.lock});\nreturn msg;","outputs":1,"noerr":2,"x":650,"y":80,"wires":[[]]},{"id":"4ece92ec.b1316c","type":"subflow","name":"Read Config Register from HMC5883L","info":"","category":"","in":[{"x":0,"y":80,"wires":[{"id":"90e06e97.6f1f9"}]}],"out":[{"x":1060,"y":80,"wires":[{"id":"c03fe9ab.3fc018","port":0}]}],"env":[],"color":"#E9967A","inputLabels":["msg trigger"],"outputLabels":["config info msg"],"icon":"font-awesome/fa-braille"},{"id":"90e06e97.6f1f9","type":"function","z":"4ece92ec.b1316c","name":"read config command","func":"return [{command:"00"},{command:"01"}];","outputs":2,"noerr":0,"x":190,"y":80,"wires":[["a71bbdca.58e44"],["a71bbdca.58e44"]],"outputLabels":["get ID1","get ID2"]},{"id":"a71bbdca.58e44","type":"i2c in","z":"4ece92ec.b1316c","name":"HMC5883L command","address":"30","command":"","count":"1","x":470,"y":80,"wires":[["5775b63c.a88a48"]]},{"id":"5775b63c.a88a48","type":"join","z":"4ece92ec.b1316c","name":"join msgs","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":690,"y":80,"wires":[["c03fe9ab.3fc018"]]},{"id":"c03fe9ab.3fc018","type":"function","z":"4ece92ec.b1316c","name":"Interpret Config","func":"var X = (msg.payload[0]<<8)+(msg.payload[1]);\n\nmsg.configreg = X;\n\nmsg.MA = (msg.payload[0] & 0x60)>>5;\nmsg.DO = (msg.payload[0] & 0x1C)>>2;\nmsg.MS = (msg.payload[0] & 0x03);\n\nmsg.GAIN = (msg.payload[1] & 0xE0)>>5;\n\nmsg.topic = "Configuration register AB";\n\nnode.status({text:"Config Reg AB: 0x"+parseInt(X).toString(16)});\nreturn msg;","outputs":1,"noerr":2,"x":890,"y":80,"wires":[[]]},{"id":"a7d743e3.5828c","type":"subflow","name":"Confirm Hardware Identity HMC5883L","info":"This subflow asks the I2C bus hardware at the\nfixed I2C address for the HMC5883L ID register\ncontents.\n\nThe ID register (A,B,C) contents returned are compared to the hardwired (immutable) value assigned to the HMC5883L in the datasheet. (p.15, Table 18, 19, 20)\n\nQ and Q' outputs as true/false outputs.","category":"","in":[{"x":40,"y":80,"wires":[{"id":"6127f0b7.9ed81"}]}],"out":[{"x":1400,"y":80,"wires":[{"id":"f7a2b90a.085d48","port":0}]},{"x":1400,"y":160,"wires":[{"id":"f7a2b90a.085d48","port":1}]}],"env":[],"color":"#E9967A","inputLabels":["msg triggered (1-shot)"],"outputLabels":["Confirmed (true/false)","Disconfirmed (true/false)"],"icon":"node-red/watch.svg"},{"id":"6127f0b7.9ed81","type":"function","z":"a7d743e3.5828c","name":"read ID command","func":"return [{command:"10"},{command:"11"},{command:"12"}];","outputs":3,"noerr":0,"x":200,"y":80,"wires":[["a57b1d62.5a84e"],["a57b1d62.5a84e"],["a57b1d62.5a84e"]],"outputLabels":["get ID1","get ID2","get ID3"]},{"id":"a57b1d62.5a84e","type":"i2c in","z":"a7d743e3.5828c","name":"HMC5883L command","address":"30","command":"","count":"1","x":490,"y":80,"wires":[["471e0bef.b8e1f4"]]},{"id":"471e0bef.b8e1f4","type":"join","z":"a7d743e3.5828c","name":"join msgs","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":710,"y":80,"wires":[["3f7a3672.c085ca"]]},{"id":"3f7a3672.c085ca","type":"function","z":"a7d743e3.5828c","name":"calc ID","func":"msg.ID="0x"+((msg.payload[0]<<16)+(msg.payload[1]<<8)+(msg.payload[2])).toString(16);\n\nmsg.topic = "Identification Register";\nnode.status({text:"ID: 0x"+parseInt(msg.ID).toString(16)});//flow coding -readable version\n \nreturn msg;","outputs":1,"noerr":2,"x":880,"y":80,"wires":[["f7a2b90a.085d48"]]},{"id":"f7a2b90a.085d48","type":"function","z":"a7d743e3.5828c","name":"Confirm HMC5883L identity","func":"if (null===msg.payload) return [{payload:false},{payload:false}];\nvar idvalue = (msg.payload[0]<<16) +(msg.payload[1]<<8) +(msg.payload[2]);\nif (0x483433 == idvalue) return [{payload:true,topic:"Confirmed HMC5883L Identity"},\n {payload:false, topic:"Disconfirmed HMC5883L Identity"}];\nelse return [{payload:false,topic:"Confirmed HMC5883L Identity"},\n {payload:true, topic:"Disconfirmed HMC5883L Identity"}];","outputs":2,"noerr":2,"x":1190,"y":80,"wires":[[],[]],"inputLabels":["3-byte identity"],"outputLabels":["Confirmed Identity","Dis-Confirmed Identity"],"info":"Checks the 3-byte input value against the HMC5883L\nID number (hard-wired register).\n\nInputs:\n3-byte msg.payload\n\nOutputs:\nConfirmed Identity: true/false\nDis-Confirmed Identity: true/false\n\nOutputs are only true when their named condition is true."},{"id":"54815778.ab7ea8","type":"inject","z":"a7d743e3.5828c","name":"wrong id test","topic":"","payload":"[1,2,3]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":890,"y":360,"wires":[["f7a2b90a.085d48"]]},{"id":"bb58d86.f44a728","type":"inject","z":"a7d743e3.5828c","name":"right id test","topic":"","payload":"[72,52,51]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":870,"y":200,"wires":[["f7a2b90a.085d48"]]},{"id":"540dbba6.abf244","type":"comment","z":"a7d743e3.5828c","name":"Send ID Request on I2C, check against Hard-wired ID","info":"","x":330,"y":180,"wires":[]},{"id":"b40cba0a.4bf348","type":"tab","label":"Digital Compass (I2C)","disabled":false,"info":""},{"id":"d3281caa.2cd7e","type":"comment","z":"b40cba0a.4bf348","name":"HMC5883L (0x1E - 7 bit addr) Digital Compass","info":"","x":310,"y":100,"wires":[]},{"id":"dcb8caac.234738","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":340,"wires":[["5febcd3b.a01434"]]},{"id":"d794b4fc.286b48","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":220,"wires":[]},{"id":"466c103b.b993f","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":180,"wires":[["ca578f04.35a87"]]},{"id":"1fac328c.e053cd","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L read Mode","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":680,"wires":[["d2fea660.2d0158"]]},{"id":"c2e95fcb.3d16a","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":770,"y":680,"wires":[]},{"id":"8d3dc9d6.72c238","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":240,"wires":[["b6690f01.4996f"]]},{"id":"ed216def.12de9","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L Continuous Mode - 00","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":780,"wires":[["1f110ad7.e0eef5"]]},{"id":"1f110ad7.e0eef5","type":"function","z":"b40cba0a.4bf348","name":"mode write","func":"return {command:"02", payload:(0x03 & msg.payload)};","outputs":1,"noerr":0,"x":590,"y":780,"wires":[["c6466b08.39b998","cc4d9d12.33b26"]],"outputLabels":["get ID1"]},{"id":"408ba033.bf746","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L Single Mode - 01","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":820,"wires":[["1f110ad7.e0eef5"]]},{"id":"c6466b08.39b998","type":"i2c out","z":"b40cba0a.4bf348","name":"send HMC5883L","address":"30","command":"","payload":"payload","payloadType":"msg","count":"1","x":810,"y":780,"wires":[]},{"id":"67d5c0a6.982a4","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L idle - 10","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":940,"wires":[["1f110ad7.e0eef5"]]},{"id":"1212a076.eded6","type":"inject","z":"b40cba0a.4bf348","name":"HMC5883L idle - 11","topic":"","payload":"3","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":900,"wires":[["1f110ad7.e0eef5"]]},{"id":"cc4d9d12.33b26","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":830,"y":820,"wires":[]},{"id":"9a386cf0.65c79","type":"comment","z":"b40cba0a.4bf348","name":"Single Mode reverts to Idle 0b11","info":"This is normal - the device makes\na single measurement and returns to\nidle mode.","x":190,"y":860,"wires":[]},{"id":"d09a30b0.2f65d","type":"comment","z":"b40cba0a.4bf348","name":"Mode get/set","info":"","x":220,"y":640,"wires":[]},{"id":"e89935a4.1766c8","type":"comment","z":"b40cba0a.4bf348","name":"Measurements","info":"","x":560,"y":500,"wires":[]},{"id":"1215bbb.fedea44","type":"inject","z":"b40cba0a.4bf348","name":"XYZ - HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":560,"wires":[["5738cbab.a8c734"]]},{"id":"c22cedf5.3dd31","type":"inject","z":"b40cba0a.4bf348","name":"info - HMC5883L ","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":280,"wires":[["5febcd3b.a01434","b6690f01.4996f","ca578f04.35a87"]]},{"id":"790d336e.86f2cc","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":790,"y":560,"wires":[]},{"id":"461dee16.b9e21","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":320,"wires":[]},{"id":"5e32406e.a1cdc","type":"debug","z":"b40cba0a.4bf348","name":"msg","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":360,"wires":[]},{"id":"5febcd3b.a01434","type":"subflow:a7d743e3.5828c","z":"b40cba0a.4bf348","name":"Confirm HMC5883L Hardware Identity","env":[],"x":620,"y":340,"wires":[["461dee16.b9e21"],["5e32406e.a1cdc"]]},{"id":"b6690f01.4996f","type":"subflow:4ece92ec.b1316c","z":"b40cba0a.4bf348","name":"Request Config Register Contents","env":[],"x":610,"y":280,"wires":[["d794b4fc.286b48"]]},{"id":"ca578f04.35a87","type":"subflow:a0533138.5facd","z":"b40cba0a.4bf348","name":"Request Status Register Contents","env":[],"x":610,"y":220,"wires":[["d794b4fc.286b48"]]},{"id":"5738cbab.a8c734","type":"subflow:338b2bd0.cc74d4","z":"b40cba0a.4bf348","name":"get X,Y,Z etc (in Gauss)","env":[],"x":570,"y":560,"wires":[["790d336e.86f2cc"]],"info":"A Rich packet is returned, including a payload of magnetic XYZ, |Mag|, etc, in the units of Gauss.\n\nEarth's magnetic field is around 0.2 ~ 0.8 Gauss where I am."},{"id":"d2fea660.2d0158","type":"subflow:3fe799fe.c01866","z":"b40cba0a.4bf348","name":"Get Current Mode","env":[],"x":560,"y":680,"wires":[["c2e95fcb.3d16a"]],"inputLabels":["trigger msg"],"outputLabels":["Rich msg packet"],"info":"Get the current mode"}]

About

A node-red flow to exercise the MPU-6050 from the Raspberry Pi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published