Exemplo n.º 1
0
def catatan():
    datapengguna = {
        'Nama': nama,
        'Time': datetime.now().strftime('%H:%M:%S'),
        'Jenis_sampah': sampah,
        'Volume': volume,
    }
    antares.setAccessKey(ANTARES_KEY)
    antares.send(datapengguna, 'TRASHSCAN', 'Pengguna')
Exemplo n.º 2
0
def sensor_send():
    while 1:
        dataKapasitif = {  #Sensor Pemisah
            'ORGANIC': 32,
            'NON_ORGANIC': 50,
        }
        dataUltrasonic = {
            'ORGANIC': organic,
            'NON_ORGANIC': non_organic,
        }
        antares.setAccessKey(ANTARES_KEY)
        antares.send(dataUltrasonic, 'TRASHSCAN', 'SensorUltrasonik')
        print("==== SEND DATA ====")
        #print(" Sensor ProximityKapasitif", dataKapasitif)
        print(" Sensor Ultrasonic", dataUltrasonic)
        print("===================")
        break
Exemplo n.º 3
0
from antares_http import antares

data = {'h': 0}
antares.setAccessKey('d2a4e28b0c316687:41fd4960fcee58c8')
antares.send(data, 'EarthquakeDetector', 'output')
Exemplo n.º 4
0
from antares_http import antares
from time import sleep
import json
from datetime import date, datetime

ANTARES_KEY = 'e75aca9711895ddc:9d6d5c89265bee66'  #Key yang di Profile

antares.setDebug(False)
antares.setAccessKey(ANTARES_KEY)

space1 = 100
space2 = 100

latestData = antares.get('TRASHSCAN', 'SensorUltrasonik')
x = json.dumps(latestData['content'])
x = json.loads(x)
non_organic = int(x['NON_ORGANIC'])
organic = int(x['ORGANIC'])

space1 = space1 - organic
space2 = space2 - non_organic

print("Nama kamu siapa? :")
nama = input()
print("Jarak kamu sama aku berapa meter ya? :")
jarak = input()
jarak = int(jarak)

while 1:
    if jarak > 1:
        print("TRASHSCAN CLOSE!")
Exemplo n.º 5
0
from antares_http import antares
import sys
import random

projectName = 'weather-station'
deviceName = 'station1'

antares.setDebug(True)
antares.setAccessKey('b4e89ce2436b9d90:202c7b14b849c084')

dataToSend = {'temp': random.randint(20, 32), 'windsp': random.randint(5, 15)}

# Get latest data
# latestData = antares.get(projectName, deviceName)

# Get all data
allData = antares.getAll(projectName, deviceName, limit=10)

# Get only data IDs
# allDataId = antares.getAllId(projectName, deviceName, limit=50)

# Get specific data
# specificData = antares.getSpecific(projectName, deviceName, 'cin_201898641')

# Get device ID
# deviceId = antares.getDeviceId(projectName, deviceName)

# Send by Device ID
# sentByDevice = antares.sendById(dataToSend, 'cnt-478686259')

# Send data