Skip to content

Commit caef267

Browse files
committed
"New build based on revision 64286"
1 parent 921b831 commit caef267

25 files changed

+242
-102
lines changed

Documentation/yoctolib-python-EN.html

Lines changed: 17 additions & 17 deletions
Large diffs are not rendered by default.

Documentation/yoctolib-python-FR.html

Lines changed: 11 additions & 10 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"main": "helloworld.py",
3+
"other_files": [],
4+
"ylib": [
5+
"yocto_spectralSensor",
6+
"yocto_api"
7+
],
8+
"skip": false,
9+
"xcode": false,
10+
"vstudio": false,
11+
"gnu": false,
12+
"cb": false
13+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# ********************************************************************
2+
#
3+
# $Id: helloworld.py 58233 2023-12-04 10:57:58Z seb $
4+
#
5+
# An example that shows how to use a Yocto-Spectral
6+
#
7+
# You can find more information on our web site:
8+
# Yocto-Spectral documentation:
9+
# https://www.yoctopuce.com/EN/products/yocto-spectral/doc.html
10+
# Python API Reference:
11+
# https://www.yoctopuce.com/EN/doc/reference/yoctolib-python-EN.html
12+
#
13+
# *********************************************************************
14+
15+
#!/usr/bin/python
16+
# -*- coding: utf-8 -*-
17+
import os, sys
18+
# add ../../Sources to the PYTHONPATH
19+
sys.path.append(os.path.join("..", "..", "Sources"))
20+
21+
from yocto_spectralsensor import *
22+
from yocto_api import *
23+
24+
25+
def usage():
26+
scriptname = os.path.basename(sys.argv[0])
27+
print("Usage:")
28+
print(scriptname + " <serial_number> <value>")
29+
print(scriptname + " <logical_name> <value>")
30+
print(scriptname + " any <value> (use any discovered device)")
31+
sys.exit()
32+
33+
34+
def die(msg):
35+
sys.exit(msg + ' (check USB cable)')
36+
37+
38+
if len(sys.argv) < 2:
39+
usage()
40+
target = sys.argv[1].upper()
41+
42+
# Setup the API to use local USB devices. You can
43+
# use an IP address instead of 'usb' if the device
44+
# is connected to a network.
45+
errmsg = YRefParam()
46+
if YAPI.RegisterHub("usb", errmsg) != YAPI.SUCCESS:
47+
sys.exit("init error" + errmsg.value)
48+
49+
if target == 'ANY':
50+
spectralSensor = YSpectralSensor.FirstSpectralSensor()
51+
if spectralSensor is None:
52+
sys.exit('No module connected (check cable)')
53+
else:
54+
i2cPort = YSpectralSensor.FindSpectralSensor(sys.argv[1] + ".spectralSensor")
55+
if not i2cPort.isOnline():
56+
sys.exit('Module not connected')
57+
58+
# sample code reading MCP9804 temperature sensor
59+
spectralSensor.set_gain(6)
60+
spectralSensor.set_integrationTime(150)
61+
spectralSensor.set_ledCurrent(6)
62+
63+
print("Near color : " + spectralSensor.get_nearSimpleColor())
64+
print("Color HEX : " + str(hex(spectralSensor.get_estimatedRGB())))
65+
YAPI.FreeAPI()

FILES.txt

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/README.md (modif:Fri Jan 12 10:48:17 2024 size:13787)
2-
/Documentation/yoctolib-python-EN.html (modif:Thu Dec 5 17:00:31 2024 size:1815969)
3-
/Documentation/yoctolib-python-FR.html (modif:Thu Dec 5 17:00:31 2024 size:2160059)
2+
/Documentation/yoctolib-python-EN.html (modif:Tue Jan 14 16:34:57 2025 size:1816104)
3+
/Documentation/yoctolib-python-FR.html (modif:Tue Jan 14 16:34:57 2025 size:2161866)
44
/Examples/Prog-FirmwareUpdate/firmwareupdate.py (modif:Tue Aug 22 12:11:02 2023 size:2845)
55
/Examples/Doc-GettingStarted-Yocto-Thermocouple/helloworld.py (modif:Mon Dec 4 11:58:56 2023 size:1975)
66
/Examples/Doc-GettingStarted-Yocto-Thermocouple/files.json (modif:Mon Mar 25 10:51:55 2024 size:220)
@@ -80,6 +80,8 @@
8080
/Examples/Doc-GettingStarted-Yocto-Amp/files.json (modif:Mon Mar 25 10:51:55 2024 size:216)
8181
/Examples/Doc-GettingStarted-Yocto-MaxiPowerRelay/helloworld.py (modif:Mon Dec 4 11:58:56 2023 size:1954)
8282
/Examples/Doc-GettingStarted-Yocto-MaxiPowerRelay/files.json (modif:Mon Mar 25 10:51:55 2024 size:214)
83+
/Examples/Doc-GettingStarted-Yocto-Spectral/helloworld.py (modif:Mon Dec 23 15:01:03 2024 size:1982)
84+
/Examples/Doc-GettingStarted-Yocto-Spectral/files.json (modif:Mon Dec 23 15:01:03 2024 size:223)
8385
/Examples/Doc-GettingStarted-Yocto-milliVolt-Rx/helloworld.py (modif:Mon Dec 4 11:58:56 2023 size:1879)
8486
/Examples/Doc-GettingStarted-Yocto-milliVolt-Rx/files.json (modif:Mon Mar 25 10:51:55 2024 size:222)
8587
/Examples/Doc-GettingStarted-Yocto-Temperature/helloworld.py (modif:Mon Dec 4 11:58:56 2023 size:1659)
@@ -152,7 +154,7 @@
152154
/Sources/yocto_spectralchannel.py (modif:Tue Oct 29 12:20:02 2024 size:7656)
153155
/Sources/yocto_genericsensor.py (modif:Mon Aug 19 14:54:15 2024 size:19248)
154156
/Sources/yocto_voltage.py (modif:Mon Aug 19 14:54:15 2024 size:8018)
155-
/Sources/yocto_colorledcluster.py (modif:Thu Nov 28 11:17:53 2024 size:44757)
157+
/Sources/yocto_colorledcluster.py (modif:Mon Jan 13 15:17:19 2025 size:44761)
156158
/Sources/yocto_anbutton.py (modif:Mon Aug 19 14:54:15 2024 size:21604)
157159
/Sources/yocto_tvoc.py (modif:Mon Mar 18 16:17:20 2024 size:6618)
158160
/Sources/yocto_files.py (modif:Fri Nov 29 09:21:58 2024 size:13348)
@@ -161,12 +163,12 @@
161163
/Sources/yocto_servo.py (modif:Mon Aug 19 14:54:15 2024 size:15984)
162164
/Sources/yocto_weighscale.py (modif:Fri Nov 29 09:21:58 2024 size:29059)
163165
/Sources/yocto_tilt.py (modif:Mon Jul 29 18:59:19 2024 size:9576)
164-
/Sources/yocto_i2cport.py (modif:Fri Nov 29 09:21:58 2024 size:46812)
166+
/Sources/yocto_i2cport.py (modif:Mon Jan 13 15:17:19 2025 size:46777)
165167
/Sources/yocto_bluetoothlink.py (modif:Mon Aug 19 14:54:15 2024 size:18225)
166168
/Sources/yocto_altitude.py (modif:Mon Mar 18 16:17:20 2024 size:9630)
167-
/Sources/yocto_rfidreader.py (modif:Fri Nov 29 09:21:58 2024 size:72997)
169+
/Sources/yocto_rfidreader.py (modif:Mon Jan 13 15:17:19 2025 size:72992)
168170
/Sources/yocto_pwminput.py (modif:Mon Mar 18 16:17:20 2024 size:19111)
169-
/Sources/yocto_colorled.py (modif:Mon Mar 18 16:17:20 2024 size:18693)
171+
/Sources/yocto_colorled.py (modif:Tue Jan 7 10:57:48 2025 size:19247)
170172
/Sources/yocto_poweroutput.py (modif:Mon Mar 18 16:17:20 2024 size:8130)
171173
/Sources/yocto_audioout.py (modif:Mon Aug 19 14:54:15 2024 size:11033)
172174
/Sources/yocto_led.py (modif:Mon Aug 19 14:54:15 2024 size:9949)
@@ -178,10 +180,10 @@
178180
/Sources/yocto_latitude.py (modif:Mon Mar 18 16:17:20 2024 size:6445)
179181
/Sources/yocto_oscontrol.py (modif:Tue Jun 11 10:31:05 2024 size:8259)
180182
/Sources/yocto_gps.py (modif:Mon Aug 19 14:54:15 2024 size:21637)
181-
/Sources/yocto_api.py (modif:Fri Dec 20 08:45:08 2024 size:360023)
183+
/Sources/yocto_api.py (modif:Mon Jan 20 09:07:10 2025 size:361379)
182184
/Sources/yocto_wakeupschedule.py (modif:Mon Aug 19 14:54:15 2024 size:17484)
183185
/Sources/yocto_segmenteddisplay.py (modif:Mon Mar 18 16:17:20 2024 size:8614)
184-
/Sources/yocto_cellular.py (modif:Fri Nov 29 09:21:58 2024 size:214476)
186+
/Sources/yocto_cellular.py (modif:Mon Jan 6 16:23:34 2025 size:214450)
185187
/Sources/yocto_display.py (modif:Fri Nov 29 09:21:58 2024 size:45818)
186188
/Sources/yocto_groundspeed.py (modif:Mon Mar 18 16:17:20 2024 size:6640)
187189
/Sources/yocto_carbondioxide.py (modif:Mon Mar 18 16:17:20 2024 size:11644)
@@ -190,14 +192,14 @@
190192
/Sources/yocto_power.py (modif:Mon Mar 18 16:17:20 2024 size:12896)
191193
/Sources/yocto_hubport.py (modif:Mon Aug 19 14:54:15 2024 size:9702)
192194
/Sources/yocto_multisenscontroller.py (modif:Mon Aug 19 14:54:15 2024 size:14609)
193-
/Sources/yocto_spectralsensor.py (modif:Mon Dec 16 12:10:50 2024 size:23845)
195+
/Sources/yocto_spectralsensor.py (modif:Thu Jan 16 11:47:19 2025 size:24509)
194196
/Sources/yocto_refframe.py (modif:Fri Nov 29 09:21:58 2024 size:36309)
195197
/Sources/yocto_accelerometer.py (modif:Mon Aug 19 14:54:15 2024 size:11275)
196198
/Sources/yocto_gyro.py (modif:Mon Mar 18 16:17:20 2024 size:26463)
197199
/Sources/yocto_micropython.py (modif:Fri Nov 29 09:21:58 2024 size:20432)
198200
/Sources/yocto_arithmeticsensor.py (modif:Fri Nov 29 09:21:58 2024 size:13802)
199201
/Sources/yocto_pwmoutput.py (modif:Mon Aug 19 14:54:15 2024 size:24570)
200-
/Sources/yocto_rangefinder.py (modif:Mon Mar 18 16:17:20 2024 size:18132)
202+
/Sources/yocto_rangefinder.py (modif:Mon Jan 13 15:17:19 2025 size:18140)
201203
/Sources/yocto_pwmpowersource.py (modif:Mon Mar 18 16:17:20 2024 size:8789)
202204
/Sources/yocto_daisychain.py (modif:Mon Mar 18 16:17:20 2024 size:9863)
203205
/Sources/yocto_wireless.py (modif:Fri Nov 29 09:21:58 2024 size:19965)
@@ -219,17 +221,17 @@
219221
/Sources/yocto_watchdog.py (modif:Mon Aug 19 14:54:15 2024 size:26633)
220222
/Sources/yocto_wakeupmonitor.py (modif:Mon Mar 18 16:17:20 2024 size:16064)
221223
/Sources/yocto_longitude.py (modif:Mon Mar 18 16:17:20 2024 size:6505)
222-
/Sources/cdll/libyapi-mips.so (modif:Fri Dec 20 09:32:21 2024 size:760585)
223-
/Sources/cdll/yapiARM.dll (modif:Fri Dec 20 09:32:27 2024 size:1067008)
224-
/Sources/cdll/libyapi-i386.so (modif:Fri Dec 20 09:32:21 2024 size:1362904)
225-
/Sources/cdll/libyapi-armhf.so (modif:Fri Dec 20 09:32:31 2024 size:1473652)
226-
/Sources/cdll/yapi64.dll (modif:Fri Dec 20 09:32:27 2024 size:1078520)
227-
/Sources/cdll/libyapi-mipsel.so (modif:Fri Dec 20 09:32:21 2024 size:757086)
228-
/Sources/cdll/libyapi.dylib (modif:Fri Dec 20 09:32:33 2024 size:2363056)
229-
/Sources/cdll/yapi.dll (modif:Fri Dec 20 09:32:27 2024 size:878328)
230-
/Sources/cdll/libyapi-amd64.so (modif:Fri Dec 20 09:32:21 2024 size:1528680)
231-
/Sources/cdll/libyapi-aarch64.so (modif:Fri Dec 20 09:32:35 2024 size:1585976)
232-
/Sources/cdll/libyapi-armel.so (modif:Fri Dec 20 09:32:32 2024 size:683386)
224+
/Sources/cdll/libyapi-mips.so (modif:Mon Jan 20 09:50:54 2025 size:763498)
225+
/Sources/cdll/yapiARM.dll (modif:Mon Jan 20 09:51:01 2025 size:1067520)
226+
/Sources/cdll/libyapi-i386.so (modif:Mon Jan 20 09:50:54 2025 size:1362904)
227+
/Sources/cdll/libyapi-armhf.so (modif:Mon Jan 20 09:51:04 2025 size:1473652)
228+
/Sources/cdll/yapi64.dll (modif:Mon Jan 20 09:51:01 2025 size:1078520)
229+
/Sources/cdll/libyapi-mipsel.so (modif:Mon Jan 20 09:50:54 2025 size:757839)
230+
/Sources/cdll/libyapi.dylib (modif:Mon Jan 20 09:51:06 2025 size:2363056)
231+
/Sources/cdll/yapi.dll (modif:Mon Jan 20 09:51:01 2025 size:879352)
232+
/Sources/cdll/libyapi-amd64.so (modif:Mon Jan 20 09:50:54 2025 size:1528712)
233+
/Sources/cdll/libyapi-aarch64.so (modif:Mon Jan 20 09:51:08 2025 size:1581888)
234+
/Sources/cdll/libyapi-armel.so (modif:Mon Jan 20 09:51:05 2025 size:683655)
233235
/Sources/yocto_voltageoutput.py (modif:Mon Mar 18 16:17:20 2024 size:10671)
234236
/Sources/yocto_humidity.py (modif:Mon Mar 18 16:17:20 2024 size:8720)
235237
/Sources/yocto_temperature.py (modif:Fri Nov 29 09:21:58 2024 size:19189)

RELEASE.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
PythonV2 v2.0.63797
1+
PythonV2 v2.0.64286
22

3-
(Misc)- purepython:now use const() for float as well //63791
4-
(Misc)- ympy_cross:fix Windows compilation //63792
3+
- Add YAPI::GetYAPISharedLibraryPath Method
4+
- Fix some memory leak
5+
- Fix YHub->isReadOnly() result if connected as admin on a protected hub.
6+
- Remove exotic char form YCellular class

Sources/cdll/libyapi-aarch64.so

-3.99 KB
Binary file not shown.

Sources/cdll/libyapi-amd64.so

32 Bytes
Binary file not shown.

Sources/cdll/libyapi-armel.so

269 Bytes
Binary file not shown.

Sources/cdll/libyapi-armhf.so

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)