element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Summer of Sensors Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Summer of Sensors Design Challenge
  • More
  • Cancel
Summer of Sensors Design Challenge
Blog VEML3328 Last-Minute Entry: Blog #3 Creating Library
  • Blog
  • Forum
  • Documents
  • Design Challenge
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Summer of Sensors Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: misaz
  • Date Created: 17 Nov 2022 8:03 PM Date Created
  • Views 739 views
  • Likes 3 likes
  • Comments 0 comments
  • vishay
  • veml3328
  • library
  • Summer of Sensors Design Challenge
  • summer of sensors
  • Exploration Station
Related
Recommended

VEML3328 Last-Minute Entry: Blog #3 Creating Library

misaz
misaz
17 Nov 2022
VEML3328 Last-Minute Entry: Blog #3 Creating Library

Hello everyone. I welcome you to my third (from five) blogs about VEML3328. I decided to join this competition in this category 6 hours before deadline. In previous blog I described my motivation and my breakout. Now I will briefly describe my own library for VEML3328 sensor which I did in recent 2 hours. Easier is to use library written by someone else, but I like making libraries because it push me to learn everything (or almost everything) possible. In case of VEML3328 it is easy because it is sensor with very simple interface. In datasheet I found that it has only one 16-bit configuration register, other 5 registers are used for retrieving data from sensor and last register is used for retrieving device id (which is 0x28, last digits from it’s name). The only configuration register looks as follows:

image

This register will be most complicated (but still easy) part of library because I need to define all bits in structures.

For writing library in hurry, I copy pasted structure from my previous library, replaced sensor name, address and rewrite logic for support VEML3328 features.

Library provides to the user following functions.

image

These functions cover whole functionality of the device. User can configure all parameters (using SetConfiguration), trigger single shoot conversion if he/she configures sensor to this mode and read data from sensor. Read functions are available in several variants differing in provided channels. You can reed all channels by RGBCIR variant but if you need only some channels, you can call function which will read only subset of channel. Reading subset of channels is better because it generates less transactions on I2C bus and it is faster.

Currently I ported library for STM32G0 platform. I will use it with Discovery board which I also ordered as part of Project14 reward. As far I have not tested the library yet. Now I go to test it and read first data form the sensor. I have not found way for visualizing data yet, so I go to work on it.

Thank you for reading this blog. In next blog I will show my project, some data from sensor when experimenting with it. I hope I will not face any strange bug which will prevent me completing project at time (in 3 hours), but as far everything looks seamless.

Next blog: VEML3328 Last-Minute Entry: Blog #4 Program and Experimenting

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube