Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Garrett omiq

View GitHub Profile
@omiq
omiq / USB_Keyboard_Hello_Goodbye.ino
Created Dec 24, 2020
USB Macro Keyboard with Arduino Micro
View USB_Keyboard_Hello_Goodbye.ino
/********************************************
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 Dec 14, 2020
TRSE vic 20 hello world bounce
View vic-hello.ras
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 Nov 25, 2018
Send '*' to Arduino + HC-08 BLE module
View BLE_Arduino.py
'''
Send '*' to Arduino + HC-08 BLE module
- Service UUID 'FFE1'
- Characteristics UUID 'FFE0'
'''
# Core Bluetooth module
@omiq
omiq / ArduinoSpeedStepper.ino
Created Oct 25, 2018
Control a Stepper with Arduino and Potentiometer Speed Control
View ArduinoSpeedStepper.ino
//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 Sep 6, 2018
Scan local area network and get info about devices (currently highlights Pi devices) * Run with Sudo
View scan-network.py
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 Aug 28, 2018
Scan your local network for the host, IP and mac address, and detect Raspberry Pi
View scan-network.py
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 Jul 20, 2018
Raspberry Pi USB keyboard emulator
View usb_keyboard.py
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 Jul 11, 2018
Load and modify an STL file and add text using Python
View python-scad.py
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 Jun 18, 2018
Get a Google map from photos using photo picker on iOS
View geo_pic_pick.py
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 Jun 14, 2018
Discord "Welcome Bot"
View steemmakers-bot.py
import os
import discord
# discord client
client = discord.Client()
def process_message(message):
args = message.content.split(" ")