Project #30 – UNIHIKER – Gravity: Analog Ambient Light Sensor – Mk03
——
#DonLucElectronics #DonLuc #UNIHIKER #AmbientLight #Display #IoT #Project #Debian #Python #Thonny #Programming #Electronics #Microcontrollers #Consultant
——
——
——
——
Gravity: Analog Ambient Light Sensor
This Gravity: Analog ambient light sensor can assist you in detecting light density and provide an analog voltage signal to the controller as feedback. Additionally, you have the ability to trigger other components within your project by setting voltage thresholds. To facilitate easier usage of the ambient light sensor, this product is designed with a universal Gravity interface that can be plugged in without requiring soldering. Two screw holes allow you to fasten it to any desired location. Making messy DuPont wires and complex connections a thing of the past and enabling you to focus your energy on your creative designs.
DL2408Mk07
1 x UNIHIKER
1 x Gravity: Analog Ambient Light Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C
UNIHIKER
ADC – 21
VIN – +5V
GND – GND
DL2408Mk07p
DL2408Mk07p.py
""" ****** Don Luc Electronics © ****** Software Version Information Project #30 - UNIHIKER - Gravity: Analog Ambient Light Sensor - Mk03 30-03 DL2408Mk07.py DL2408Mk07 1 x UNIHIKER 1 x Gravity: Analog Ambient Light Sensor 1 x USB Battery Pack 1 x USB 3.1 Cable A to C -*- coding: utf-8 -*- """ # Import the unihiker library from unihiker import GUI # Import the time library import time # Import the Board module from the pinpong.board package from pinpong.board import Board # Import all modules from the pinpong.extension.unihiker package from pinpong.extension.unihiker import * # Initialize the board by selecting the board type and port number; # if not specified, the program will automatically detect it Board().begin() # Initialize pin 21 as analog input mode # Gravity: Analog Ambient Light Sensor adc0 = Pin(Pin.P21, Pin.ANALOG) # Instantiate the GUI class and create a gui object gui = GUI() # Display the initial background image 'DL2408Mk07p' img = gui.draw_image(x=0, y=0, w=240, h=320, image='DL2408Mk07p.png') # Ambient Light Sensor # Display the initial Ambient Light Sensor valueLight valueLight = gui.draw_text(x=30, y=151, text='0', font_size=18) # Gravity: Analog Ambient Light Sensor # Display the initial Gravity: Analog Ambient Light Sensor valueAnalogLight valueAnalogLight = gui.draw_text(x=30, y=221, text='0', font_size=18) while True: # Ambient Light Sensor # Read the light value AmbientLightSensor = light.read() # Update the displayed light value valueLight.config(text=AmbientLightSensor) # Gravity: Analog Ambient Light Sensor # Read analog value AnalogAmbientLightSensor = adc0.read_analog() valueAnalogLight.config(text=AnalogAmbientLightSensor) # Delay for 1 second to keep the screen content displayed for a longer time time.sleep(1)
People can contact us: https://www.donluc.com/?page_id=1927
Teacher, Instructor, E-Mentor, R&D and Consulting
- Programming Language
- Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc…)
- IoT
- Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
- Robotics
- Automation
- Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
- Unmanned Vehicles Terrestrial and Marine
- Machine Learning
- Artificial Intelligence (AI)
- RTOS
- Sensors, eHealth Sensors, Biosensor, and Biometric
- Research & Development (R & D)
- Consulting
Follow Us
Luc Paquin – Curriculum Vitae – 2024
https://www.donluc.com/luc/
Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/
DFRobot Luc.Paquin: https://edu.dfrobot.com/dashboard/makelogs
Hackster.io: https://www.hackster.io/neosteam-labs
LinkedIn: https://www.linkedin.com/in/jlucpaquin/
Don Luc
Leave a Reply