Skip to content

Instantly share code, notes, and snippets.

View Pranjal-R-Agrawal's full-sized avatar

Pranjal Agrawal Pranjal-R-Agrawal

View GitHub Profile
def format_compound(formula):
f_formula = ""
for part in formula.split("."):
for i in range(0, len(part)):
if i + 1 < len(part):
if part[i].isalpha() and (part[i + 1].isupper() or part[i + 1] in ["(", "[", ")", "]"]):
f_formula += part[i] + "1"
elif part[i] in [")", "]"] and part[i + 1].isalpha():
f_formula += part[i] + "1"
else:
from sympy import *
init_printing(use_unicode=True)
import math
import re
# H3PO4 + (NH4)2MoO4 + HNO3 + H2O-> (NH4)3PO4.12MoO3 + NH4NO3
def subscript(s): # Function to convert number to subscript. 8320 is the ascii of subscript 0
i = 0
while i < len(s):
#include <Servo.h>
//---------------------------------------------------speed declaration-----------------------------------------------------------
int P, D, I;
float error, previousError;
int lsp, rsp;
int lfspeed = 160;//<<<<<<<<<<<<<<<<<---------Change speed here<<<<<<<<<<<<<<<<<<<<<<<
int minspeed = 0 ;
int maxspeed = 255;
#include <Servo.h>
//---------------------------------------------------speed declaration-----------------------------------------------------------
int P, D, I;
float error, previousError;
int lsp, rsp;
int lfspeed = 160;//<<<<<<<<<<<<<<<<<---------Change speed here<<<<<<<<<<<<<<<<<<<<<<<
int minspeed = 0 ;
int maxspeed = 255;