Skip to content

Instantly share code, notes, and snippets.

@cbaretzky
cbaretzky / voxelizer.py
Last active November 5, 2017 16:59
quick and dirty voxelizer for blender outputs ascii with ones and zeros #badcode
import bpy
from mathutils import *
from math import *
import time
import os
#written in 2012, first python program, first time using blender API
#originally the ray_cast function was used but it was not well documented and highly inaccurate
#code checks for consistency of the returned values (watertight mesh)
@cbaretzky
cbaretzky / main.py
Created November 5, 2017 16:45
main.py for wio link running micropython, dht-11 and ds18b20 sensors attached, connecting to domoticz mqtt server
from umqtt.simple import MQTTClient
from time import sleep_ms
from ds18x20 import DS18X20
from onewire import OneWire
import dht
server = "192.168.2.109" #mqtt server
node_number = "Link_0" #name to be transmitted to mqtt
mqtt_c = MQTTClient(node_number, server)
try:
@cbaretzky
cbaretzky / boot.py
Created November 5, 2017 16:12
boot.py for esp8266 with micropython
# This file is executed on every boot (including wake-boot from deepsleep)
#Get out of the UART with mismatched baudrate on the serial
print(' '*40+'\n')
print('Start booting')
autoconnect_timeout = 80
deepsleep_seconds = 2000
fail_deepsleep = 600
known_APS=[['AP1','PW1'], #AP1 : SSID of first AP, PW1 passwd for first AP