Skip to content

Instantly share code, notes, and snippets.

Avatar

Inderpreet Singh inderpreet

View GitHub Profile
View module7-9.cpp
#include <iostream>
void banner();
void m7_t1();
void m7_t2();
void m7_t3();
void m8_t1();
void m8_t2();
void m8_t3();
View gist:a552f03b61ebefbe135dea8fcbea568f
import RPi.GPIO as G
import time
G.setmode(G.BCM)
G.setwarnings(False)
G.setup(7, G.OUT)
G.setup(25, G.IN, pull_up_down=G.PUD_UP)
toggle = 1
data = 1
@inderpreet
inderpreet / apache2.conf
Created Nov 24, 2021
apache config for the etec224 course
View apache2.conf
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
View etec224-button-led.py
#!/usr/bin/python3
import RPi.GPIO as GPIO
import time
LED_G = 16
LED_Y = 20
LED_R = 21
PBT1 = 17
@inderpreet
inderpreet / etec224-button.py
Created Nov 24, 2021
etec224 button with 3 leds code
View etec224-button.py
#!/usr/bin/python3
import RPi.GPIO as GPIO
from time import sleep
LED_G = 21
BUTTON = 17
PRESSED = 0
RELEASED = 1
@inderpreet
inderpreet / Drawer-menu.js
Created May 3, 2021 — forked from alexanmtz/Drawer-menu.js
A tab menu example using Material-UI for react
View Drawer-menu.js
// styles
const styles = theme => ({
iconContainer: {
display: 'none',
[theme.breakpoints.down('sm')]: {
display: 'block'
}
}
})
@inderpreet
inderpreet / mqtt.py
Created Mar 16, 2021 — forked from stylpen/mqtt.py
python MQTT wrapper
View mqtt.py
import thread, mosquitto, random, time
# mosquitto reference and download can be found here: http://mosquitto.org/documentation/python/
class mqtt():
def __init__(self, broker = "127.0.0.1", port = 1883, clientID = None):
self.__broker = broker
self.__port = port
self._client = None
self.__subscriptionsList = []
self.__pendingSubscriptionsList = []
View student_database_with_python.py
#!/usr/bin/python3
# Import statements for libraries
import time
import MySQLdb
# Variable placeholders
Done = False
@inderpreet
inderpreet / keysight_psu_01.py
Created Apr 28, 2019
A script to display text on the Keysight PSU
View keysight_psu_01.py
#!/usr/bin/env python
import visa
rm = visa.ResourceManager()
rm.list_resources()
inst = rm.open_resource('TCPIP0::192.168.5.185::5025::SOCKET')
# print(inst.query("*IDN?"))
View bbc_microbit_remote.py
"""
@file bbc_tx
@brief BBC microbit Receiver By Inderpreet Singh
"""
import radio
import random
from microbit import * #import display, Image, button_a, sleep, button_b,
music = False
lights = False