Last active
February 23, 2026 15:09
-
-
Save kenwebb/5f8fc6f595fc503a0b32820c4cd86f61 to your computer and use it in GitHub Desktop.
VEML7700 RPiZero Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Mon Feb 23 2026 10:09:27 GMT-0500 (Eastern Standard Time)--> | |
| <XholonWorkbook> | |
| <Notes><![CDATA[ | |
| Xholon | |
| ------ | |
| Title: VEML7700 RPiZero Python | |
| Description: | |
| Url: http://www.primordion.com/Xholon/gwt/ | |
| InternalName: 5f8fc6f595fc503a0b32820c4cd86f61 | |
| Keywords: | |
| My Notes | |
| -------- | |
| 2026 Feb 23 | |
| Notes on getting the Adafruit VEML7700 Light Sensor board working on a Raspberry Pi Zero 2 W, using Python (Circuit Python). | |
| ### References | |
| (1) https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi_Zero/ | |
| Grove Base Hat for Raspberry Pi Zero | |
| (2) https://github.com/adafruit/Adafruit_VEML7700 | |
| Adafruit_VEML7700 Build Status | |
| This is the Adafruit VEML7700 Lux sensor library | |
| Tested and works great with the Adafruit VEML7700 Breakout Board | |
| This chip uses I2C to communicate, 2 pins are required to interface | |
| (3) https://learn.adafruit.com/adafruit-veml7700/python-circuitpython | |
| VEML7700 RPiZero Python | |
| Adafruit VEML7700 Ambient Light Sensor | |
| Easily add ambient light sensing to your project with this high accuracy I2C sensor! | |
| last edited January 22, 2025 | |
| Python & CircuitPython | |
| It's easy to use the VEML7700 sensor with CircuitPython and the Adafruit CircuitPython VEML7700 module. | |
| This module allows you to easily write Python code that reads the ambient light levels, including Lux, from the sensor. | |
| You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, | |
| our CircuitPython-for-Python compatibility library. | |
| CircuitPython Microcontroller Wiring | |
| First wire up a VEML7700 to your board exactly as follows. Here is an example of the VEML7700 wired to a Feather using I2C: | |
| ... | |
| - shows wiring for RPi | |
| - how to install code | |
| - simple Python example | |
| (4) https://circuitpython.org/blinka | |
| Blinka brings CircuitPython APIs and, therefore, CircuitPython libraries to single board computers (SBCs). | |
| It is a pip installable Python library that runs in normal "desktop" Python. | |
| The CircuitPython runtime isn't used. | |
| CircuitPython libraries can also be installed via pip. | |
| See the guide for further details. | |
| - this page is just a lot of pictures of boards with links | |
| (5) https://docs.circuitpython.org/en/latest/README.html | |
| CircuitPython is a beginner friendly, open source version of Python for tiny, inexpensive computers called microcontrollers. | |
| Microcontrollers are the brains of many electronics including a wide variety of development boards used to build hobby projects and prototypes. | |
| CircuitPython in electronics is one of the best ways to learn to code because it connects code to reality. | |
| Simply install CircuitPython on a supported USB board usually via drag and drop and then edit a code.py file on the CIRCUITPY drive. | |
| The code will automatically reload. No software installs are needed besides a text editor (we recommend Mu for beginners.) | |
| Starting with CircuitPython 7.0.0, some boards may only be connectable over Bluetooth Low Energy (BLE). | |
| Those boards provide serial and file access over BLE instead of USB using open protocols. | |
| (Some boards may use both USB and BLE.) | |
| BLE access can be done from a variety of apps including code.circuitpython.org. | |
| CircuitPython features unified Python core APIs and a growing list of 300+ device libraries and drivers that work with it. | |
| These libraries also work on single board computers with regular Python via the Adafruit Blinka Library. | |
| CircuitPython is based on MicroPython. See below for differences. | |
| Most, but not all, CircuitPython development is sponsored by Adafruit and is available on their educational development boards. | |
| Please support both MicroPython and Adafruit. | |
| (6) https://github.com/adafruit/Adafruit_Blinka | |
| This repository contains a selection of packages emulating the CircuitPython API for devices or hosts running CPython or MicroPython. | |
| Working code exists to emulate these CircuitPython packages: | |
| ... | |
| - do I need this? | |
| (7) https://learn.adafruit.com/circuitpython-on-raspberrypi-linux | |
| CircuitPython Libraries on Linux and Raspberry Pi | |
| Make hardware and interface with sensors super easy using CircuitPython libraries | |
| published June 30, 2018, last edited November 25, 2025 | |
| This guide describes using CircuitPython libraries on small Linux computers, running under regular Python. | |
| It is not about running the CircuitPython firmware itself on those boards. | |
| CircuitPython Libraries on Desktop Linux | |
| By adding a software layer, you can use CircuitPython hardware control capabilities with "regular Python", | |
| as found on your desktop or single-board Linux computer. | |
| There are tons of projects, libraries and example code for CircuitPython on microcontrollers, and | |
| thanks to the flexibility and power of Python its' pretty easy to get that code working on micro-computers | |
| like the Raspberry Pi or other single-board Linux computers with GPIO pins available. | |
| You'll use a special library called adafruit_blinka (named after Blinka, the CircuitPython mascot) | |
| that provides a layer that translates the CircuitPython hardware API to whatever library the Linux board provides. | |
| For example, on Raspberry Pi we use the python RPi.GPIO library.\ | |
| For any I2C interfacing we'll use ioctl messages to the /dev/i2c device. | |
| For SPI we'll use the spidev python library, etc. | |
| These details don't matter so much because they all happen underneath the adafruit_blinka layer. | |
| The upshot is that most code we write for CircuitPython will be instantly and easily runnable on Linux computers like Raspberry Pi. | |
| In particular, you'll be able to use all of our device drivers - the sensors, led controllers, motor drivers, HATs, bonnets, etc. | |
| And nearly all of these use I2C or SPI! | |
| The rest of this guide describes how to install and set up Blinka, and | |
| then how to use it to run CircuitPython code to control hardware. | |
| (8) | |
| ]]></Notes> | |
| <_-.XholonClass> | |
| <!-- domain objects --> | |
| <PhysicalSystem/> | |
| <Block/> | |
| <Brick/> | |
| <!-- quantities --> | |
| <Height superClass="Quantity"/> | |
| </_-.XholonClass> | |
| <xholonClassDetails> | |
| <Block> | |
| <port name="height" connector="Height"/> | |
| </Block> | |
| </xholonClassDetails> | |
| <PhysicalSystem> | |
| <Block> | |
| <Height>0.1 m</Height> | |
| </Block> | |
| <Brick multiplicity="2"/> | |
| </PhysicalSystem> | |
| <Blockbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[ | |
| var a = 123; | |
| var b = 456; | |
| var c = a * b; | |
| if (console) { | |
| console.log(c); | |
| } | |
| //# sourceURL=Blockbehavior.js | |
| ]]></Blockbehavior> | |
| <Heightbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[ | |
| var myHeight, testing; | |
| var beh = { | |
| postConfigure: function() { | |
| testing = Math.floor(Math.random() * 10); | |
| myHeight = this.cnode.parent(); | |
| }, | |
| act: function() { | |
| myHeight.println(this.toString()); | |
| }, | |
| toString: function() { | |
| return "testing:" + testing; | |
| } | |
| } | |
| //# sourceURL=Heightbehavior.js | |
| ]]></Heightbehavior> | |
| <Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[ | |
| $wnd.xh.Brickbehavior = function Brickbehavior() {} | |
| $wnd.xh.Brickbehavior.prototype.postConfigure = function() { | |
| this.brick = this.cnode.parent(); | |
| this.iam = " red brick"; | |
| }; | |
| $wnd.xh.Brickbehavior.prototype.act = function() { | |
| this.brick.println("I am a" + this.iam); | |
| }; | |
| //# sourceURL=Brickbehavior.js | |
| ]]></Brickbehavior> | |
| <Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[ | |
| console.log("I'm another brick behavior"); | |
| ]]></Brickbehavior> | |
| <SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml, | |
| <svg width="100" height="50" xmlns="http://www.w3.org/2000/svg"> | |
| <g> | |
| <title>Block</title> | |
| <rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/> | |
| <g> | |
| <title>Height</title> | |
| <rect id="PhysicalSystem/Block/Height" fill="#6AB06A" height="50" width="10" x="80" y="0"/> | |
| </g> | |
| </g> | |
| </svg> | |
| ]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient> | |
| </XholonWorkbook> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment