Skip to content

Commit 0049ec2

Browse files
Merge branch 'dev'
2 parents 65c4ba9 + 2c3fc1f commit 0049ec2

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

letmecreate/click/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- 8x8R (LED matrix)
66
- Accel
77
- ADC
8+
- Air quality
89
- Alcohol
910
- Bargraph
1011
- CO
@@ -22,7 +23,7 @@
2223
- Thermo3
2324
"""
2425

25-
__all__ = ['seven_seg', 'led_matrix', 'accel', 'adc', 'alcohol', 'bargraph',
26-
'color', 'color2', 'eve', 'ir_distance', 'ir_eclipse', 'joystick',
27-
'motion', 'proximity', 'relay', 'relay2', 'relay4', 'thermo3',
28-
'CO']
26+
__all__ = ['seven_seg', 'led_matrix', 'accel', 'adc', 'air_quality', 'alcohol',
27+
'bargraph', 'color', 'color2', 'eve', 'ir_distance', 'ir_eclipse',
28+
'joystick', 'motion', 'proximity', 'relay', 'relay2', 'relay4',
29+
'thermo3', 'CO']

letmecreate/click/air_quality.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
"""Python binding of Air quality Click wrapper of LetMeCreate library."""
3+
4+
import ctypes
5+
6+
_LIB = ctypes.CDLL('libletmecreate_click.so')
7+
8+
9+
def get_measure(mikrobus_index):
10+
"""Measure in the air using the Air Quality click.
11+
12+
mikrobus_index: must be 0 (MIKROBUS_1) or 1 (MIKROBUS_2)
13+
14+
Note: An exception is thrown if it fails to communicate with the air
15+
quality click.
16+
"""
17+
value = ctypes.c_uint16(0)
18+
ret = _LIB.air_quality_click_get_measure(mikrobus_index, ctypes.byref(value))
19+
if ret < 0:
20+
raise Exception("air quality click read ppm failed")
21+
return value.value

letmecreate/click/co.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_measure(mikrobus_index):
1313
1414
Note: An exception is thrown if it fails to communicate with the CO click.
1515
"""
16-
value = ctypes.c_uint16_t(0)
16+
value = ctypes.c_uint16(0)
1717
ret = _LIB.co_click_get_measure(mikrobus_index, ctypes.byref(value))
1818
if ret < 0:
1919
raise Exception("co click read ppm failed")

miscellaneous/Makefile.devel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=python3-letmecreate
4-
PKG_VERSION:=1.0.2
4+
PKG_VERSION:=1.2.1
55

66
PKG_LICENSE_FILE:=LICENSE
77
PKG_LICENSE:=BSD-3-Clause

miscellaneous/Makefile.stable

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=python3-letmecreate
4-
PKG_VERSION:=1.2.0
4+
PKG_VERSION:=1.2.1
55

66
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
77
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

0 commit comments

Comments
 (0)