Skip to content

Instantly share code, notes, and snippets.

View tdowgielewicz's full-sized avatar

Tomasz Dowgielewicz tdowgielewicz

  • Gdańsk Poland
View GitHub Profile
@tdowgielewicz
tdowgielewicz / CAN1 and CAN2 test [CAN bus Cortex M-3 LPC1768 LandTiger]
Last active December 11, 2022 17:58
User friendly CAN usage toutorial - CooCox LandTiger LPC1768 Cortex M3
// ================== CAN1 and CAN2 LPC1768 test ===========================//
//CooCox IDE
/* "I was just starting my journey with uC and CAN so it was real PIA to understand whole stuff.
* This example have much more rich comments so it will be easier for newbie to understand what is going on
* Ensure that before you start with this example you know how CAN work. I also assume that you are already
* after GPIO basics chapter
This example was build on LandTiger v2.0 board (LPC1768). In this board there are CAN 2 controllers
with transceivers are available:
@tdowgielewicz
tdowgielewicz / USB support LPC1768
Created August 8, 2014 08:06
USB support LPC1768
/**
*****************************************************************************
* @title USB_CDC.c
* @author Lean966
* @date 14 Jul 2011
* @brief USB Device as CDC for LPC17xx, the character are recived and tra
* smitted on the simulated VCOM .
* Note: the same example, could b
* e used for the LPC17xx USB CDC stack.
@tdowgielewicz
tdowgielewicz / bluetooth raspberry-pi
Created March 27, 2018 09:06 — forked from lexruee/bluetooth raspberry-pi
install bluetooth and pybluez
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
@tdowgielewicz
tdowgielewicz / VSCodeExtension.py
Created July 29, 2018 11:00 — forked from harry-cpp/VSCodeExtension.py
VSCode extension for Nautilus
# VSCode Nautilus Extension
#
# Place me in ~/.local/share/nautilus-python/extensions/, restrart Nautilus, and enjoy :)
# mkdir -p ~/.local/share/nautilus-python/extensions && cp -f VSCodeExtension.py ~/.local/share/nautilus-python/extensions/VSCodeExtension.py && nautilus -q
#
# This script was written by cra0zy and is released to the public domain
from gi import require_version
require_version('Gtk', '3.0')
require_version('Nautilus', '3.0')
def autodict(*args):
"""
Creates dictonary from python variables where key is variable name and value is var value
:param args: python variables
:return: dictonary
"""
g = {k: v for k, v in globals().items() if not k.startswith('__')}
result = {}
for arg in args:
@tdowgielewicz
tdowgielewicz / navy_ships.py
Last active October 10, 2019 19:54
US Navy shpis commission per year chart
import requests
from datetime import datetime
import dateparser
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from bs4 import BeautifulSoup
url = 'https://en.wikipedia.org/wiki/List_of_current_ships_of_the_United_States_Navy'
html_content = requests.get(url).text