Skip to content

Instantly share code, notes, and snippets.

View Shashi18's full-sized avatar
🎯
Focusing

Shashi Suman Shashi18

🎯
Focusing
View GitHub Profile
import sys
from pygame.locals import *
import numpy as np
import pygame as pg
import random
import time
start = time.time()
FPS = 150 # frames per second setting
@Shashi18
Shashi18 / IM5.py
Created October 20, 2017 09:31
Image classifier in 5 minutes. For explanation click http://www.hellocodings.com/2017/10/build-neural-network-classifier-in-5.html
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10 18:44:48 2017
@author: shash
"""
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import *
#include<Wire.h>
const int MPU_addr=0x68;
double AccelX,AccelY,AccelZ,Tmp,GyroX,GyroY,GyroZ; //These will be the raw data from the MPU6050.
uint32_t timer; //it's a timer, saved as a big-ass unsigned int. We use it to save times from the "micros()" command and subtract the present time in microseconds from the time stored in timer to calculate the time for each loop.
double Angle_X, Angle_Y; //These are the angles in the complementary filter
#define degconvert 57.29577951 //there are like 57 degrees in a radian.
double currentAngle = 0;
#define m1_left 12
#define m1_right 10
module master(data,address,clk,rw,sda,scl,register,data_wr);
output reg sda;
input [7:0] data;
input [7:0] data_wr;
reg [7:0]data_wr_dup;
input clk;
input rw;
output reg scl;
input [6:0] address;
input [7:0] register;
@Shashi18
Shashi18 / Po.ino
Last active December 15, 2017 14:11
Self Balancing Robot
/* Developed By: www.hellocodings.com----------------------------
---Shashi Suman--------------------------------------------------
---Modify as you want--------------------------------------------
---------------------------------------------------------------*/
#include<Wire.h>
const int MPU_addr=0x68;
double AccelX,AccelY,AccelZ,Tmp,GyroX,GyroY,GyroZ; //These will be the raw data from the MPU6050.
uint32_t timer; //it's a timer, saved as a big-ass unsigned int. We use it to save times from the "micros()" command and subtract the present time in microseconds from the time stored in timer to calculate the time for each loop.
double Angle_X, Angle_Y; //These are the angles in the complementary filter
#define degconvert 57.29577951 //there are like 57 degrees in a radian.
@Shashi18
Shashi18 / Self Balancing Robot.ino
Created December 18, 2017 09:47
Self Balancing Robot Arduino
#include <PID_v1.h>
#include <Wire.h>
const int MPU_addr=0x68;
double AccelX,AccelY,AccelZ,Tmp,GyroX,GyroY,GyroZ; //These will be the raw data from the MPU6050.
uint32_t timer; //it's a timer, saved as a big-ass unsigned int. We use it to save times from the "micros()" command and subtract the present time in microseconds from the time stored in timer to calculate the time for each loop.
double Angle_X, Angle_Y; //These are the angles in the complementary filter
#define degconvert 57.29577951 //there are like 57 degrees in a radian.
#define m1_left 12
#include <PID_v1.h>
#include <Wire.h>
const int MPU_addr=0x68;
double AccelX,AccelY,AccelZ,Tmp,GyroX,GyroY,GyroZ; //These will be the raw data from the MPU6050.
uint32_t timer; //it's a timer, saved as a big-ass unsigned int. We use it to save times from the "micros()" command and subtract the present time in microseconds from the time stored in timer to calculate the time for each loop.
double Angle_X, Angle_Y; //These are the angles in the complementary filter
#define degconvert 57.29577951 //there are like 57 degrees in a radian.
#define m1_left 12
@Shashi18
Shashi18 / WebSockets.ino
Last active February 28, 2018 20:27
WebSocket ESP8266
#include <ESP8266WiFi.h>
#include <WebSocketsServer.h>
const char* ssid = "********";
const char* password = "**********";
const int pinLed0 = 2;
uint8_t num;
int a = 0;
WebSocketsServer webSocket = WebSocketsServer(81);
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, height=device-height">
<script>
var con;
function web(){
con = new WebSocket('ws://192.168.1.5:81/',['arduino']);
con.onopen = function(event){
module Slave(
inout sda,
input scl
);
parameter [6:0] address = 7'b1101001;
reg [7:0] temp = 8'bx;
reg [6:0] s_add;
parameter [6:0] register = 7'b1001010;
reg[7:0] array[0:75];
reg[7:0] array2[0:75];