#Parameter changes for the radar mode = 1 # Waveform mode set to 1, continous wave (CW). f0 = 5 # Operation mode set from 24.005 to 24.245 GHz. BW = 240 # Operation bandwidth in the other ramp modes. Ns = 200 # Number of samples. Range value 38 to 21 samples/sec [50 to 200]. Ntar = 5 # Maximum number of targets to detect from 1 to 5. Rmax = 60 # Maximum distance the targets will be searched from 0 to 75. MTI = 1 # Moving targets Indication, when activated alll static objects are ignored. Mth = 3 # Defines the sensitivity of the radar. From 1(low) to 4(high). # results output array movement = [0] # load the configuration uRAD.loadConfiguration(mode, f0, BW, Ns, Ntar, Rmax, MTI, Mth) # switch ON uRAD uRAD.turnON() birdCount = 0 #Retrieving data from the website openweather.org. def getWeatherData(): url = 'http://api.openweathermap.org/data/2.5/weather?q=Trondheim,no&appid=ab285d3403cbfd7b88c9cace599e592d' res = requests.get(url) data = res.json() temp = data['main']['temp'] wind_speed = data['wind']['speed'] latitude = data['coord']['lat']
from flask import Flask, render_template, request import json #app = Flask(__name__) uMode = 3 uFrequency = 5 uBW = 240 uSamples = 200 uTargets = 5 uMaxRange = 50 uMTI = 0 uMovement = 1 # Initialze With Configurations uRAD.loadConfiguration(uMode, uFrequency, uBW, uSamples, uTargets, uMaxRange, uMTI, uMovement) # Storage Variables distances = [0, 0, 0, 0, 0] SNR = [0, 0, 0, 0, 0] movement = [0] api_dict = {} # Switch on URAD uRAD.turnON() while True: past_distance = distances uRAD.detection(distances, 0, SNR, 0, 0, movement) for idx in range(0, 5):