Skip to content

Instantly share code, notes, and snippets.

View omiq's full-sized avatar

Chris Garrett omiq

View GitHub Profile
@omiq
omiq / USB_Keyboard_Hello_Goodbye.ino
Created December 24, 2020 03:47
USB Macro Keyboard with Arduino Micro
/********************************************
USB Keyboard Hello World, Goodbye Zoom!
MakerHacks.com 12/2020
*********************************************/
// The library that does the magicx
#include "Keyboard.h"
// Right now our "keyboard" has one key
#define KEY_PIN 2
@omiq
omiq / vic-hello.ras
Created December 14, 2020 18:19
TRSE vic 20 hello world bounce
program MainProgram;
/*
Vic 20 8K Vic Bitmap Mode template
- can utilize up to 35K RAM under project settings
-------------------
Dev Note: Zero Page addresses have been defined in project settings
for the Vic 20 build.
@omiq
omiq / BLE_Arduino.py
Created November 25, 2018 03:31
Send '*' to Arduino + HC-08 BLE module
'''
Send '*' to Arduino + HC-08 BLE module
- Service UUID 'FFE1'
- Characteristics UUID 'FFE0'
'''
# Core Bluetooth module
@omiq
omiq / ArduinoSpeedStepper.ino
Created October 25, 2018 00:31
Control a Stepper with Arduino and Potentiometer Speed Control
//Arduino stepper library
#include <Stepper.h>
// different steppers have different
// amount of steps to do a full
// turn of the wheel.
#define STEPS 32
// connections need to be done carefully
@omiq
omiq / scan-network.py
Last active September 6, 2018 03:22
Scan local area network and get info about devices (currently highlights Pi devices) * Run with Sudo
import sys
import nmap
import time
nm = nmap.PortScanner()
nm.scan('10.0.1.0/24', '22')
# clear screen
sys.stdout.write(u"\u001b[2J\u001b[0;0H")
sys.stdout.flush()
time.sleep(0.2)
@omiq
omiq / scan-network.py
Created August 28, 2018 21:26
Scan your local network for the host, IP and mac address, and detect Raspberry Pi
import sys
import nmap
import time
nm = nmap.PortScanner()
nm.scan('10.0.1.0/24', '22')
# clear screen
sys.stdout.write(u"\u001b[2J\u001b[0;0H")
sys.stdout.flush()
time.sleep(0.2)
@omiq
omiq / usb_keyboard.py
Created July 20, 2018 02:21
Raspberry Pi USB keyboard emulator
import time
import RPi.GPIO as GPIO
# We are going to use the BCM numbering
GPIO.setmode(GPIO.BCM)
# Set pin 26 as input using pull up resistor
GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)
@omiq
omiq / python-scad.py
Created July 11, 2018 01:32
Load and modify an STL file and add text using Python
import os
from solid import *
from PIL import Image
def assembly(annotation=""):
a = import_stl("base.stl") + translate([5, -37, 10])(
linear_extrude(height=2, convexity=4)(
text(annotation,
@omiq
omiq / geo_pic_pick.py
Created June 18, 2018 23:11
Get a Google map from photos using photo picker on iOS
import photos
import webbrowser
picked = photos.pick_asset()
print(dir(picked))
geo_loc = picked.location
lat = geo_loc['latitude']
long = geo_loc['longitude']
map_url = "comgooglemaps://www.google.com/maps/?q={},{}".format(lat,long)
print(map_url)
@omiq
omiq / steemmakers-bot.py
Created June 14, 2018 15:14
Discord "Welcome Bot"
import os
import discord
# discord client
client = discord.Client()
def process_message(message):
args = message.content.split(" ")