No changes between revisions
/Modules/Sensors/ALTIMET01A/SW/Python/ALTIMET01A_test.py
0,0 → 1,60
#!/usr/bin/python
 
# Python test script for MLAB ALTIMET01A sensor
 
import time
import datetime
import sys
import serial
 
from pymlab import config
 
 
#### Script Arguments ###############################################
 
if len(sys.argv) != 2:
sys.stderr.write("Invalid number of arguments.\n")
sys.stderr.write("Usage: %s #I2CPORT\n" % (sys.argv[0], ))
sys.exit(1)
 
port = eval(sys.argv[1])
 
 
#### Sensor Configuration ###########################################
 
cfg = config.Config(
i2c = {
"port": port,
},
 
bus = [
{
"type": "i2chub",
"address": 0x72,
"children": [
{"name": "altimet", "type": "altimet01" , "channel": 7, },
],
},
],
)
cfg.initialize()
gauge = cfg.get_device("altimet")
time.sleep(0.5)
 
#### Data Logging ###################################################
 
sys.stdout.write("ALTIMET data acquisition system started \n")
 
try:
while True:
gauge.route()
(t1, p1) = gauge.get_tp()
sys.stdout.write(" Temperature: %.2f Pressure: %d \n" % (t1, p1))
sys.stdout.flush()
# time.sleep(0.5)
except KeyboardInterrupt:
ser.close()
sys.exit(0)
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Modules/Sensors/ALTIMET01A/SW/Python/ALTIMET_test.ipynb
1,6 → 1,6
{
"metadata": {
"name": "ALTIMET_test"
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
35,15 → 35,12
"output_type": "stream",
"stream": "stdout",
"text": [
"i2c-0\ti2c \ti915 gmbus ssc \tI2C adapter\r\n",
"i2c-1\ti2c \ti915 gmbus vga \tI2C adapter\r\n",
"i2c-2\ti2c \ti915 gmbus panel \tI2C adapter\r\n",
"i2c-3\ti2c \ti915 gmbus dpc \tI2C adapter\r\n",
"i2c-4\ti2c \ti915 gmbus dpb \tI2C adapter\r\n",
"i2c-5\ti2c \ti915 gmbus dpd \tI2C adapter\r\n",
"i2c-6\ti2c \tDPDDC-C \tI2C adapter\r\n",
"i2c-7\ti2c \tDPDDC-D \tI2C adapter\r\n",
"i2c-8\ti2c \ti2c-tiny-usb at bus 001 device 006\tI2C adapter\r\n"
"i2c-5\ti2c \ti2c-tiny-usb at bus 002 device 008\tI2C adapter\r\n",
"i2c-0\ti2c \tintel drm CRTDDC_A \tI2C adapter\r\n",
"i2c-1\ti2c \tintel drm LVDSBLC_B \tI2C adapter\r\n",
"i2c-2\ti2c \tintel drm LVDSDDC_C \tI2C adapter\r\n",
"i2c-3\ti2c \tintel drm HDMIB \tI2C adapter\r\n",
"i2c-4\ti2c \tDPDDC-B \tI2C adapter\r\n"
]
}
],
76,7 → 73,7
"cell_type": "code",
"collapsed": false,
"input": [
"port = 8"
"port = 5"
],
"language": "python",
"metadata": {},
119,9 → 116,7
"collapsed": false,
"input": [
"cfg = config.Config(\n",
" i2c = {\n",
" \"port\": port,\n",
" },\n",
" port = port,\n",
" bus = [\n",
" {\n",
" \"type\": \"i2chub\",\n",
186,8 → 181,8
"output_type": "stream",
"stream": "stdout",
"text": [
"(0, 21.3125, 98476.75)\n",
"(1, 21.3125, 98476.75)"
"(0, 22.0, 96976.25)\n",
"(1, 22.0, 96978.0)"
]
},
{
195,7 → 190,7
"stream": "stdout",
"text": [
"\n",
"(2, 21.3125, 98476.75)"
"(2, 22.0, 96978.0)"
]
},
{
203,7 → 198,7
"stream": "stdout",
"text": [
"\n",
"(3, 21.3125, 98480.25)"
"(3, 22.0, 96976.75)"
]
},
{
211,7 → 206,7
"stream": "stdout",
"text": [
"\n",
"(4, 21.3125, 98480.25)"
"(4, 22.0, 96976.75)"
]
},
{
219,7 → 214,7
"stream": "stdout",
"text": [
"\n",
"(5, 21.3125, 98480.25)"
"(5, 22.0, 96978.5)"
]
},
{
227,7 → 222,7
"stream": "stdout",
"text": [
"\n",
"(6, 21.3125, 98480.25)"
"(6, 22.0, 96978.5)"
]
},
{
235,7 → 230,7
"stream": "stdout",
"text": [
"\n",
"(7, 21.3125, 98476.75)"
"(7, 22.0, 96976.25)"
]
},
{
243,7 → 238,7
"stream": "stdout",
"text": [
"\n",
"(8, 21.3125, 98476.75)"
"(8, 22.0, 96976.25)"
]
},
{
251,7 → 246,7
"stream": "stdout",
"text": [
"\n",
"(9, 21.3125, 98480.5)"
"(9, 22.0, 96982.25)"
]
},
{
259,7 → 254,7
"stream": "stdout",
"text": [
"\n",
"(10, 21.3125, 98480.5)"
"(10, 22.0, 96982.25)"
]
},
{
267,7 → 262,7
"stream": "stdout",
"text": [
"\n",
"(11, 21.3125, 98482.0)"
"(11, 22.0, 96978.0)"
]
},
{
275,7 → 270,7
"stream": "stdout",
"text": [
"\n",
"(12, 21.3125, 98482.0)"
"(12, 22.0, 96978.0)"
]
},
{
283,7 → 278,7
"stream": "stdout",
"text": [
"\n",
"(13, 21.3125, 98484.5)"
"(13, 22.0, 96976.75)"
]
},
{
291,7 → 286,7
"stream": "stdout",
"text": [
"\n",
"(14, 21.3125, 98480.5)"
"(14, 22.0, 96976.75)"
]
},
{
299,7 → 294,7
"stream": "stdout",
"text": [
"\n",
"(15, 21.3125, 98476.5)"
"(15, 22.0, 96976.0)"
]
},
{
307,7 → 302,7
"stream": "stdout",
"text": [
"\n",
"(16, 21.3125, 98480.5)"
"(16, 22.0, 96976.0)"
]
},
{
315,7 → 310,7
"stream": "stdout",
"text": [
"\n",
"(17, 21.3125, 98480.5)"
"(17, 22.0, 96982.0)"
]
},
{
323,7 → 318,7
"stream": "stdout",
"text": [
"\n",
"(18, 21.3125, 98482.25)"
"(18, 22.0, 96982.0)"
]
},
{
331,7 → 326,7
"stream": "stdout",
"text": [
"\n",
"(19, 21.3125, 98482.25)"
"(19, 22.0, 96972.75)"
]
},
{
339,7 → 334,7
"stream": "stdout",
"text": [
"\n",
"(20, 21.3125, 98482.25)"
"(20, 22.0, 96972.75)"
]
},
{
347,7 → 342,7
"stream": "stdout",
"text": [
"\n",
"(21, 21.3125, 98482.25)"
"(21, 22.0, 96982.0)"
]
},
{
355,7 → 350,7
"stream": "stdout",
"text": [
"\n",
"(22, 21.3125, 98482.75)"
"(22, 22.0, 96982.0)"
]
},
{
363,7 → 358,7
"stream": "stdout",
"text": [
"\n",
"(23, 21.3125, 98482.75)"
"(23, 22.0, 96976.75)"
]
},
{
371,7 → 366,7
"stream": "stdout",
"text": [
"\n",
"(24, 21.3125, 98478.5)"
"(24, 22.0, 96976.75)"
]
},
{
379,7 → 374,7
"stream": "stdout",
"text": [
"\n",
"(25, 21.3125, 98478.5)"
"(25, 22.0, 96978.75)"
]
},
{
387,7 → 382,7
"stream": "stdout",
"text": [
"\n",
"(26, 21.3125, 98482.5)"
"(26, 22.0, 96978.75)"
]
},
{
395,7 → 390,7
"stream": "stdout",
"text": [
"\n",
"(27, 21.3125, 98482.5)"
"(27, 22.0, 96978.5)"
]
},
{
403,7 → 398,7
"stream": "stdout",
"text": [
"\n",
"(28, 21.3125, 98486.75)"
"(28, 22.0, 96978.5)"
]
},
{
411,7 → 406,7
"stream": "stdout",
"text": [
"\n",
"(29, 21.3125, 98482.75)"
"(29, 22.0, 96978.75)"
]
},
{
419,7 → 414,7
"stream": "stdout",
"text": [
"\n",
"(30, 21.3125, 98482.75)"
"(30, 22.0, 96976.75)"
]
},
{
427,7 → 422,7
"stream": "stdout",
"text": [
"\n",
"(31, 21.3125, 98480.25)"
"(31, 22.0, 96976.75)"
]
},
{
435,7 → 430,7
"stream": "stdout",
"text": [
"\n",
"(32, 21.3125, 98480.25)"
"(32, 22.0, 96972.75)"
]
},
{
443,7 → 438,7
"stream": "stdout",
"text": [
"\n",
"(33, 21.3125, 98478.25)"
"(33, 22.0, 96976.75)"
]
},
{
451,7 → 446,7
"stream": "stdout",
"text": [
"\n",
"(34, 21.3125, 98478.25)"
"(34, 22.0, 96978.5)"
]
},
{
459,7 → 454,7
"stream": "stdout",
"text": [
"\n",
"(35, 21.3125, 98478.25)"
"(35, 22.0, 96978.5)"
]
},
{
467,7 → 462,7
"stream": "stdout",
"text": [
"\n",
"(36, 21.3125, 98478.25)"
"(36, 22.0, 96978.25)"
]
},
{
475,7 → 470,7
"stream": "stdout",
"text": [
"\n",
"(37, 21.3125, 98478.25)"
"(37, 22.0, 96978.25)"
]
},
{
483,7 → 478,7
"stream": "stdout",
"text": [
"\n",
"(38, 21.3125, 98478.25)"
"(38, 22.0, 96976.5)"
]
},
{
491,7 → 486,7
"stream": "stdout",
"text": [
"\n",
"(39, 21.3125, 98480.75)"
"(39, 22.0, 96976.5)"
]
},
{
499,7 → 494,7
"stream": "stdout",
"text": [
"\n",
"(40, 21.3125, 98480.75)"
"(40, 22.0, 96976.75)"
]
},
{
507,7 → 502,7
"stream": "stdout",
"text": [
"\n",
"(41, 21.3125, 98482.25)"
"(41, 22.0, 96976.75)"
]
},
{
515,7 → 510,7
"stream": "stdout",
"text": [
"\n",
"(42, 21.3125, 98482.25)"
"(42, 22.0, 96980.75)"
]
},
{
523,7 → 518,7
"stream": "stdout",
"text": [
"\n",
"(43, 21.3125, 98478.25)"
"(43, 22.0, 96980.75)"
]
},
{
531,7 → 526,7
"stream": "stdout",
"text": [
"\n",
"(44, 21.3125, 98478.25)"
"(44, 22.0, 96976.25)"
]
},
{
539,7 → 534,7
"stream": "stdout",
"text": [
"\n",
"(45, 21.3125, 98478.25)"
"(45, 22.0, 96976.25)"
]
},
{
547,7 → 542,7
"stream": "stdout",
"text": [
"\n",
"(46, 21.3125, 98482.0)"
"(46, 22.0, 96974.25)"
]
},
{
555,7 → 550,7
"stream": "stdout",
"text": [
"\n",
"(47, 21.3125, 98482.0)"
"(47, 22.0, 96974.25)"
]
},
{
563,7 → 558,7
"stream": "stdout",
"text": [
"\n",
"(48, 21.3125, 98484.5)"
"(48, 22.0, 96972.25)"
]
},
{
571,7 → 566,7
"stream": "stdout",
"text": [
"\n",
"(49, 21.3125, 98484.5)"
"(49, 22.0, 96972.25)"
]
},
{
579,7 → 574,7
"stream": "stdout",
"text": [
"\n",
"(50, 21.3125, 98476.5)"
"(50, 22.0, 96978.25)"
]
},
{
587,7 → 582,7
"stream": "stdout",
"text": [
"\n",
"(51, 21.3125, 98476.5)"
"(51, 22.0, 96978.25)"
]
},
{
595,7 → 590,7
"stream": "stdout",
"text": [
"\n",
"(52, 21.3125, 98478.75)"
"(52, 22.0, 96976.25)"
]
},
{
603,7 → 598,7
"stream": "stdout",
"text": [
"\n",
"(53, 21.3125, 98478.75)"
"(53, 22.0, 96976.25)"
]
},
{
611,7 → 606,7
"stream": "stdout",
"text": [
"\n",
"(54, 21.3125, 98480.25)"
"(54, 22.0, 96978.5)"
]
},
{
619,7 → 614,7
"stream": "stdout",
"text": [
"\n",
"(55, 21.3125, 98480.25)"
"(55, 22.0, 96978.5)"
]
},
{
627,7 → 622,7
"stream": "stdout",
"text": [
"\n",
"(56, 21.3125, 98480.0)"
"(56, 22.0, 96978.5)"
]
},
{
635,7 → 630,7
"stream": "stdout",
"text": [
"\n",
"(57, 21.3125, 98480.0)"
"(57, 22.0, 96978.5)"
]
},
{
643,7 → 638,7
"stream": "stdout",
"text": [
"\n",
"(58, 21.3125, 98482.0)"
"(58, 22.0, 96978.0)"
]
},
{
651,7 → 646,7
"stream": "stdout",
"text": [
"\n",
"(59, 21.3125, 98482.0)"
"(59, 22.0, 96978.0)"
]
},
{
659,7 → 654,7
"stream": "stdout",
"text": [
"\n",
"(60, 21.3125, 98482.0)"
"(60, 22.0, 96978.0)"
]
},
{
667,7 → 662,7
"stream": "stdout",
"text": [
"\n",
"(61, 21.3125, 98476.25)"
"(61, 22.0, 96978.25)"
]
},
{
675,7 → 670,7
"stream": "stdout",
"text": [
"\n",
"(62, 21.3125, 98476.25)"
"(62, 22.0, 96978.25)"
]
},
{
683,7 → 678,7
"stream": "stdout",
"text": [
"\n",
"(63, 21.3125, 98480.75)"
"(63, 22.0, 96976.0)"
]
},
{
691,7 → 686,7
"stream": "stdout",
"text": [
"\n",
"(64, 21.3125, 98480.75)"
"(64, 22.0, 96980.0)"
]
},
{
699,7 → 694,7
"stream": "stdout",
"text": [
"\n",
"(65, 21.3125, 98480.5)"
"(65, 22.0, 96976.0)"
]
},
{
707,7 → 702,7
"stream": "stdout",
"text": [
"\n",
"(66, 21.3125, 98480.5)"
"(66, 22.0, 96976.0)"
]
},
{
715,7 → 710,7
"stream": "stdout",
"text": [
"\n",
"(67, 21.3125, 98482.0)"
"(67, 22.0, 96976.0)"
]
},
{
723,7 → 718,7
"stream": "stdout",
"text": [
"\n",
"(68, 21.3125, 98482.0)"
"(68, 22.0, 96976.0)"
]
},
{
731,7 → 726,7
"stream": "stdout",
"text": [
"\n",
"(69, 21.3125, 98482.25)"
"(69, 22.0, 96976.5)"
]
},
{
739,7 → 734,7
"stream": "stdout",
"text": [
"\n",
"(70, 21.3125, 98482.25)"
"(70, 22.0, 96976.5)"
]
},
{
747,7 → 742,7
"stream": "stdout",
"text": [
"\n",
"(71, 21.375, 98482.75)"
"(71, 22.0, 96976.75)"
]
},
{
755,7 → 750,7
"stream": "stdout",
"text": [
"\n",
"(72, 21.375, 98486.75)"
"(72, 22.0, 96976.75)"
]
},
{
763,7 → 758,7
"stream": "stdout",
"text": [
"\n",
"(73, 21.3125, 98484.25)"
"(73, 22.0, 96978.75)"
]
},
{
771,7 → 766,7
"stream": "stdout",
"text": [
"\n",
"(74, 21.3125, 98480.25)"
"(74, 22.0, 96978.75)"
]
},
{
779,7 → 774,7
"stream": "stdout",
"text": [
"\n",
"(75, 21.3125, 98480.25)"
"(75, 22.0, 96980.75)"
]
},
{
787,7 → 782,7
"stream": "stdout",
"text": [
"\n",
"(76, 21.3125, 98480.5)"
"(76, 22.0, 96980.75)"
]
},
{
795,7 → 790,7
"stream": "stdout",
"text": [
"\n",
"(77, 21.3125, 98480.5)"
"(77, 22.0, 96976.25)"
]
},
{
803,7 → 798,7
"stream": "stdout",
"text": [
"\n",
"(78, 21.3125, 98482.5)"
"(78, 22.0, 96976.25)"
]
},
{
811,7 → 806,7
"stream": "stdout",
"text": [
"\n",
"(79, 21.3125, 98482.5)"
"(79, 22.0, 96976.75)"
]
},
{
819,7 → 814,7
"stream": "stdout",
"text": [
"\n",
"(80, 21.3125, 98482.0)"
"(80, 22.0, 96976.75)"
]
},
{
827,7 → 822,7
"stream": "stdout",
"text": [
"\n",
"(81, 21.3125, 98482.0)"
"(81, 22.0, 96980.25)"
]
},
{
835,7 → 830,7
"stream": "stdout",
"text": [
"\n",
"(82, 21.375, 98480.0)"
"(82, 22.0, 96980.25)"
]
},
{
843,7 → 838,7
"stream": "stdout",
"text": [
"\n",
"(83, 21.375, 98480.0)"
"(83, 22.0, 96978.25)"
]
},
{
851,7 → 846,7
"stream": "stdout",
"text": [
"\n",
"(84, 21.3125, 98476.0)"
"(84, 22.0, 96978.25)"
]
},
{
859,7 → 854,7
"stream": "stdout",
"text": [
"\n",
"(85, 21.3125, 98476.0)"
"(85, 22.0, 96978.75)"
]
},
{
867,7 → 862,7
"stream": "stdout",
"text": [
"\n",
"(86, 21.3125, 98478.5)"
"(86, 22.0, 96978.75)"
]
},
{
875,7 → 870,7
"stream": "stdout",
"text": [
"\n",
"(87, 21.3125, 98478.5)"
"(87, 22.0, 96982.0)"
]
},
{
883,7 → 878,7
"stream": "stdout",
"text": [
"\n",
"(88, 21.3125, 98478.5)"
"(88, 22.0, 96982.0)"
]
},
{
891,7 → 886,7
"stream": "stdout",
"text": [
"\n",
"(89, 21.3125, 98478.0)"
"(89, 22.0, 96982.75)"
]
},
{
899,7 → 894,7
"stream": "stdout",
"text": [
"\n",
"(90, 21.375, 98478.0)"
"(90, 22.0, 96976.0)"
]
},
{
907,7 → 902,7
"stream": "stdout",
"text": [
"\n",
"(91, 21.375, 98484.0)"
"(91, 22.0, 96976.0)"
]
},
{
915,7 → 910,7
"stream": "stdout",
"text": [
"\n",
"(92, 21.3125, 98484.0)"
"(92, 22.0, 96980.75)"
]
},
{
923,7 → 918,7
"stream": "stdout",
"text": [
"\n",
"(93, 21.3125, 98480.0)"
"(93, 22.0, 96976.75)"
]
},
{
931,7 → 926,7
"stream": "stdout",
"text": [
"\n",
"(94, 21.3125, 98480.0)"
"(94, 22.0, 96974.25)"
]
},
{
939,7 → 934,7
"stream": "stdout",
"text": [
"\n",
"(95, 21.3125, 98478.5)"
"(95, 22.0, 96978.25)"
]
},
{
947,7 → 942,7
"stream": "stdout",
"text": [
"\n",
"(96, 21.3125, 98478.5)"
"(96, 22.0, 96976.5)"
]
},
{
955,7 → 950,7
"stream": "stdout",
"text": [
"\n",
"(97, 21.3125, 98476.75)"
"(97, 22.0, 96976.5)"
]
},
{
963,7 → 958,7
"stream": "stdout",
"text": [
"\n",
"(98, 21.3125, 98476.75)"
"(98, 21.9375, 96972.5)"
]
},
{
971,7 → 966,7
"stream": "stdout",
"text": [
"\n",
"(99, 21.3125, 98482.75)"
"(99, 21.9375, 96972.5)"
]
},
{
/Modules/Sensors/ALTIMET01A/SW/Python/data_logger.py
1,6 → 1,6
#!/usr/bin/python
 
# Python example utility for MLAB ALTIMET01A testing bed with DPI145.
# Python driver for MLAB ALTIMET01A module with HMC5888L Magnetometer sensor wrapper class
 
import time
import datetime