Skip to content

Instantly share code, notes, and snippets.

View akshaybaweja's full-sized avatar
🏠
Working from home

Akshay Baweja akshaybaweja

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python3
import minimalmodbus
import serial
powerMeter = minimalmodbus.Instrument('/dev/ttyUSB0', 1)
powerMeter.serial.baudrate = 9600
powerMeter.serial.bytesize = 8
powerMeter.serial.parity = serial.PARITY_NONE
powerMeter.serial.stopbits = 1
powerMeter.mode = minimalmodbus.MODE_RTU
@akshaybaweja
akshaybaweja / getZoomInfo.py
Created July 7, 2021 04:48
Zoom Controller
import osascript
scpt = '''
set vol to ((output volume of (get volume settings)) + 5)
if (vol > 100) then set vol to 100
set volume output volume (vol)
display notification ((vol) as string)
'''
@akshaybaweja
akshaybaweja / recipe_analysis.ipynb
Last active April 5, 2021 19:01
recipe_analysis.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import re
import urllib.request
import markovify
from time import sleep
def scrape():
originalLyrics = open('lyrics.txt', 'w')
url = "https://www.azlyrics.com/l/linkinpark.html"
artistHtml = urllib.request.urlopen(url)
So I'm bright in the middle of it, middle of it Man, who are you?
I don't win, if I'm wrong, then I'm halfway right I know I'm not the one that you don't know what to do When all I know what to do was slow down But I was the only one And there's nothing more fucked up I could stand up and take Fuck it Are you listening?
So, one last lie I can tell Should've played it safer from the top to the bottom!
You know she had to find out for y'all in the design Of the line.
And it can't be outrun.
@akshaybaweja
akshaybaweja / week_10_processing.pde
Created November 20, 2019 07:22
Processing <> Arduino
import apsync.*; //for syncing data with arduino; SerialEvent fails in processing hence this library helps!!
import processing.serial.*;
import processing.sound.*;
Serial myPort; // Create object from Serial class
AP_Sync streamer;
public int distance;
PImage backdrop, eggo;
@akshaybaweja
akshaybaweja / week_10_arduino.ino
Last active November 20, 2019 07:22
Processing <> Arduino
#include <AP_Sync.h> //for syncing data to processing; SerialEvent fails in processing hence this library helps!!
AP_Sync streamer(Serial);
const int pingPin = 9; // Trigger Pin of Ultrasonic Sensor
const int echoPin = 11; // Echo Pin of Ultrasonic Sensor
void setup() {
Serial.begin(9600); // Starting Serial Terminal
}
#include <SoftPWM.h>
#include <FastLED.h>
#include <CapacitiveSensor.h>
const int led1[] = {3, 4, 5};
const int led2[] = {6, 7, 8};
const int led3[] = {9, 10, 11};
static uint8_t hue;
CapacitiveSensor cs_4_2 = CapacitiveSensor(12, 2);
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define PIN1 8
#define PIN2 7
#define ANALOG_PIN A0
#define SWITCH 2
#define LED 13
LiquidCrystal_I2C lcd(0x27, 16, 2);
#include <Servo.h>
int potPin = 0;
int servoPin = 9;
Servo servo;
void setup()
{
servo.attach(servoPin);
}