Skip to content

Instantly share code, notes, and snippets.

View JasonLS's full-sized avatar
🎯
Focusing

JasonLS JasonLS

🎯
Focusing
View GitHub Profile
from __future__ import print_function
import re
import sys
import select
import atexit
import termios
import optparse
try:
from evdev import InputDevice, categorize, ecodes
import Motors
import Servo
LT=310
RT=311
LB=308
RB=309
LR=16
UPDN=17
@JasonLS
JasonLS / LEDstrip.c
Last active August 28, 2018 20:15
C code to use a basic led strip. this example code should light 4 LEDs in order from Red, Green, Blue, White.
#include <stdio.h>
#include <unistd.h>
//Green = DI
//Blue = CI
//BLack = GND
//Red = PWR
#define ledcount 4
@JasonLS
JasonLS / 7segment.c
Created August 28, 2018 20:09
C code to use baconbits two 7 segment displays
#include <stdio.h>
#include <unistd.h>
int main() {
FILE * spidev = fopen("/dev/spidev2.1", "wb");
//Left 7 Segment
fwrite("\x40\x00\xc0", 1, 3, spidev);//"0's" are on, "1's" are off
//Right 7 Segment
fwrite("\x40\x01\xc0", 1, 3, spidev);
//You should see the segments look like zeroes.
@JasonLS
JasonLS / gist:e94e5340c700d6083070283794b1c44c
Last active August 17, 2018 17:10
BBORG_DISPLAY18-00A2.txt
/* Work in Progress */
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
/dts-v1/;
/plugin/;
/ {
@JasonLS
JasonLS / gist:d72bbfa58cda8b5170f781cff8e920ff
Created August 16, 2018 22:06
BBORG_DISPLAY18-00A2.txt
/*
* Copyright (C) 2013 CircuitCo
* Copyright (C) 2018 Drew Fustini <drew@beagleboard.org>
*
* Adafruit 1.8" TFT LCD on SPI1 bus using tinydrm st7735r driver
*
* LICENSE:
* --------
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
MOTOR CAPE
M1 HIGH = P8_18
M2 HIGH = P8_16
M3 HIGH = P8_14
M4 HIGH = P8_26
Set to low to go backwards, high to go forwards
M1 PWM = P9_16
M2 PWM = P9_14
#48x32 31.416 inches = full rotation at
#from bbpystepper import Stepper
#find battety cord and solder cord to connect to H Bridge
# connect GND of H bridge to beaglebone
import Adafruit_BBIO.PWM as PWM
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
import time
#48x32 31.416 inches = full rotation at
#from bbpystepper import Stepper
#find battety cord and solder cord to connect to H Bridge
# connect GND of H bridge to beaglebone
import Adafruit_BBIO.PWM as PWM
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
import time
namespace BrainPadApplication5
{
//Includes all of the libraries necessary for the code to run
using System;
using System.Diagnostics;
using System.Threading;
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Devices.Adc;
using GHIElectronics.TinyCLR.Pins;