Skip to content

Commit 0c6bbf3

Browse files
committed
Fix pressure() and tests
1 parent a648a23 commit 0c6bbf3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/LPS25H.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ function LPS25H_pressure()
2020
smbus_read(CTRL_REG2) == 0 && break # check if finished
2121
end
2222

23-
pressure = (Int32(smbus_read(0x2a)) << 16 | Int16(smbus_read(0x29)) << 8 | smbus_read(0x28)) / 4096
23+
pressure = (UInt64.(smbus_read(0x2a)) << 16 |
24+
UInt64.(smbus_read(0x29)) << 8 |
25+
UInt64.(smbus_read(0x28)))/4096.0
2426

2527
smbus_write(CTRL_REG1, 0x00) # power down
2628
return pressure
2729
end
2830

2931
"""
30-
HTS221_temperature()
32+
LPS25H_temperature()
3133
3234
The temperature (in °C) from the LPS25H sensor.
3335
"""

test/led.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using SenseHat
2-
using Base.Test
2+
using Test
33

44
using ColorTypes
55

test/sensors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Test
22
using SenseHat
33

44
@test -40 <= temperature() <= 60

0 commit comments

Comments
 (0)