Skip to content

Instantly share code, notes, and snippets.

View rafitc's full-sized avatar

Rafi Rasheed T C rafitc

View GitHub Profile
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
#define lenght 16.0
unsigned int peace;
unsigned char b;
int count=0;
int aft=1;
int buz = 6;
int motor = 7; //motor switch
@rafitc
rafitc / ubi.py
Last active February 22, 2020 15:08
import numpy as np
import requests
import time
import cv2
TOKEN = "BBFF-P6yTdAtbxDpl0NkDMbrbgNA0zy9T4X" # Put your TOKEN here
DEVICE_LABEL = "machine" # Put your device label here
VARIABLE_LABEL_1 = "people" # Put your first variable label here
int IRSensor = 2; // connect ir sensor to arduino pin 2
int RelayOutput = 10; // conect Relay to arduino pin 10
int spdt = 5; //connet SPDT switch
int flag = 0;
void setup() {
pinMode (IRSensor, INPUT); // sensor pin INPUT
pinMode (RelayOutput, OUTPUT); // Led pin OUTPUT
pinMode(spdt, INPUT_PULLUP); //spdt as a input
}
int RelayOutput = 12; // conect Relay to arduino pin 12
int flag = 0;
// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;
void setup(){
pinMode(10, INPUT);
Serial.begin(9600);
}
void loop(){
int s = digitalRead(10);
Serial.println(s);
}
#include <avr/wdt.h>
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#include <RH_ASK.h>
#include <SPI.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <EEPROM.h>
// Absolute min and max eeprom addresses. Actual values are hardware-dependent.
// These values can be changed e.g. to protect eeprom cells outside this range.
const int EEPROM_MIN_ADDR = 0;
const int EEPROM_MAX_ADDR = 511;
// Returns true if the address is between the
// minimum and maximum allowed values, false otherwise.
//
// This function is used by the other, higher-level functions
const request = require('request');
const options = {
url: 'https://api.edamam.com/search?q=chicken&app_id=2212ac86&app_key=c15684e291aa4073912e4c99dec07227&from=0&to=3&calories=0-722&health=alcohol-free&diet=balanced&excluded=egg',
method: 'GET',
headers: {
'Accept': 'application/json',
'Accept-Charset': 'utf-8',
'User-Agent': 'my-reddit-client'
#include <Wire.h> //i2c libraray
#include <RH_ASK.h> //RadioHead to for RF Tran
#include <SPI.h> //RadioHead dependencies
const char *msg1 = "1"; //Trigger message
int notifyLed = 3;
int hitValue ;
RH_ASK rf_driver; //creating object
#define coefficient_A 19.32
#define coefficient_B -0.64
#define R_Load 10.0
int sensValue;
int pin = A0;
void setup(){
Serial.begin(9600);
}