I'm a french student and with my team we want to create a smart meter with a light sensor. So we bought 2 kit LoPy with 2 expansions board and 2 antenna. We want to connect this 2 cards far from them using LoRa but we don't have any knowledge on python. We only learned Arduino. So I want to know how to use a basic light sensor with the LoPy card.
I'm actually using this code, because I'm looking to get the blink of the meter.
Know I need to find when the led is blinking, because he send everytime the value. I want to know how to check the difference between this value and the last one.
livius last edited by livius
If you need the value from your analog light sensor
then simply use ACD for this e.g:
from machine import ADC adc = ADC(0) light = adc.channel(pin='P13',attn=ADC.ATTN_11DB) #read current light value value = light()
Hello, sorry for the overdue.
I'm using a basic lightsensor wich is used with arduino as you can see on this picture :
@mrbombastiks You could have used a Pysense which has a light sensor built-in (if by light sensor you mean something that measures ambient light level).
seb last edited by
Do you know what particular light sensor you will be using for your project? Some just provide an analog voltage, others have digital interfaces.