Hi there,
I am trying to setup a weather station using a BME280 and 18B20 sensor.
I have a Pi3 new rasbian loaded and updated.
I am following steps from this build https://projects.raspberrypi.org/en/pro ... -station/2
this is the step I am on and the code I have written but I get an error.
import bme280
import smbus2
from time import sleep
port = 1
address = 0x77 # Adafruit BME280 address. Other BME280s may be different
bus = smbus2.SMBus(port)
bme280.load_calibration_params(bus,address)
while True:
bme280_data = bme280.sample(bus,address)
humidity = bme280_data.humidity
pressure = bme280_data.pressure
ambient_temperature = bme280_data.temperature
print(humidity, pressure, ambient_temperature)
sleep(1)
Error
Python 3.7.3 (/usr/bin/python3)
>>> %Run test.py
Traceback (most recent call last):
File "/home/pi/test.py", line 17
sleep(1)
^
SyntaxError: invalid syntax
I am a noob at this stuff but trying to figure it out.
Thanks in advance