$ cat bmp280.py # Distributed with a free-will license. # Use it any way you want, profit or free, provided it fits in the licenses of its associated works. # BMP280 # This code is designed to work with the BMP280_I2CS I2C Mini Module available from ControlEverything.com. # https://www.controleverything.com/content/Barometer?sku=BMP280_I2CSs#tabs-0-product_tabset-2 import smbus import time
# Get I2C bus bus = smbus.SMBus(1)
# BMP280 address, 0x76(118) # Read data back from 0x88(136), 24 bytes b1 = bus.read_i2c_block_data(0x76, 0x88, 24)
# BMP280 address, 0x76(118) # Select Control measurement register, 0xF4(244) # 0x27(39) Pressure and Temperature Oversampling rate = 1 # Normal mode bus.write_byte_data(0x76, 0xF4, 0x27) # BMP280 address, 0x76(118) # Select Configuration register, 0xF5(245) # 0xA0(00) Stand_by time = 1000 ms bus.write_byte_data(0x76, 0xF5, 0xA0)
time.sleep(0.5)
# BMP280 address, 0x76(118) # Read data back from 0xF7(247), 8 bytes # Pressure MSB, Pressure LSB, Pressure xLSB, Temperature MSB, Temperature LSB # Temperature xLSB, Humidity MSB, Humidity LSB data = bus.read_i2c_block_data(0x76, 0xF7, 8)
# Convert pressure and temperature data to 19-bits adc_p = ((data[0] * 65536) + (data[1] * 256) + (data[2] & 0xF0)) / 16 adc_t = ((data[3] * 65536) + (data[4] * 256) + (data[5] & 0xF0)) / 16
$ cat /proc/cpuinfo processor : 0 BogoMIPS : 38.40 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4
odroid-c2
$ cat /proc/cpuinfo processor : 0 BogoMIPS : 2.00 Features : fp asimd crc32 CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4
Program received signal SIGILL, Illegal instruction. 0x0000005555555720 in opal_sys_timer_freq ()
MRS Move the contents of the CPSR or SPSR to a general-purpose register.
Usage Use MRS in combination with MSR as part of a read-modify-write sequence for updating a PSR, for example to change processor mode, or to clear the Q flag.
Caution You must not attempt to access the SPSR when the processor is in User or System mode. This is your responsibility. The assembler cannot warn you about this as it does not know what processor mode code will be executed in.
Architectures This instruction is available in ARM architecture versions 3 and above.
걍 armbian 하니 잘 된다. 커널 버전이나 aarch64 지원이 미흡한 구버전 커널이라 그럴수도 있을 듯 하다.
minimonk@odroidc2:~$ mpirun -------------------------------------------------------------------------- mpirun could not find anything to do.
It is possible that you forgot to specify how many processes to run via the "-np" argument. --------------------------------------------------------------------------