Skip to content

Instantly share code, notes, and snippets.

@dglaude
dglaude / PokemonGo automation
Created March 22, 2017 00:25
ESP8266+Micropython+LDR+Servo=PokemonGo Plus Automation
f=open('main.py','w')
f.write('''import pokemon
pokemon.main()''')
f.close()
f=open('pokemon.py','w')
f.write('''import machine, time
p12 = machine.Pin(12)
adc = machine.ADC(0)
@dglaude
dglaude / README.md
Last active April 1, 2017 19:07
Inspiring LED and other APA on [Pocket]CHIP
@dglaude
dglaude / thinker.md
Last active December 31, 2023 15:12
Projects logs of David Glaude based on twitter post
@dglaude
dglaude / BlueDotBlinktColorPicker.py
Last active June 2, 2017 22:49
HSV color control of the Blinkt! from a Blue Dot.
#!/usr/bin/env python
from bluedot import BlueDot
import colorsys
import time
import blinkt
def move(pos):
# print("The Blue Dot x={} y={} d={} a={}".format(pos.x, pos.y, pos.distance, pos.angle))
h=((pos.angle+180) % 360) / 360
@dglaude
dglaude / irrgbcontrol.py
Created June 24, 2017 13:14
Source code for my test of IRLibCP. This control an RGB strip in infrared.
# IRLibCP by Chris Young. See copyright.txt and license.txt
# Sample program for sending one value of NEC protocol.
# See https://github.com/cyborg5/IRLibCP
#
# Adapted by David Glaude to send a command from a list in sequence at each press of A.
# I use this to control an RGB strip from Circuit Playground Express.
import digitalio
import time
import board
import IRLib_P01_NECs
@dglaude
dglaude / testpattern.py
Created August 9, 2017 22:11
Test program to check every LEDs of your Unicorn HD HAT from @pimoroni
#!/usr/bin/env python
import time
import unicornhathd
print("""Unicorn HAT HD: Test pattern
Press Ctrl+C to exit!
""")
try:
@dglaude
dglaude / AIM_Raspbianx86.md
Last active August 12, 2017 20:35
Notes on installing Adventure in Minecraft on Raspbian x86

I am working on a PC with Raspbian x86 installed from the bootable DVD comming from RaspiMag N°60.

I did basic stuff to change the password and update to the lattest version:

passwd 
sudo apt-get update
sudo apt-get upgrade
@dglaude
dglaude / Notes.md
Last active May 1, 2019 20:11
Where is Everybody in Adventure in Minecraft

Raspberry Pi comes with a very special version of Minecraft.

That free version is bost limited and extensible because you can write a program that interact with the game. But that version is also mono player, so the Python programming API does not offer information about multiple player.

In the book Adventure in Minecraft of Martin O'Hanlon and David Whale, there are instruction to do the same thing on PC and MAC. This involve a trick to locally start a moddified version of the Minecraft server, based on Bukkit. That version include an API compatible with the one available on Raspberry Pi, that is the RaspberryJuice plugin. But because you now have a full Minecraft server, you can have multiple simultaneous connected users.

@dglaude
dglaude / getPlayerEntityId.md
Last active August 13, 2017 19:07
Error with getPlayerEntityId if the username is not connected to the server

This program test the function mc.getPlayerEntityId in two case.

Case 1: The user "Present" that is connected to the server Case 2: The user "Absent" that is not connected to the server

# http://eu.wiley.com/WileyCDA/WileyTitle/productCd-111894691X.html

# The Minecraft API has to be imported before it can be used
import mcpi.minecraft as minecraft
@dglaude
dglaude / main.py
Created October 31, 2017 20:12
Circuit Python scrolling rainbow
# Trinket DotStar demo
# Welcome to CircuitPython 2.1.0
import board
import adafruit_dotstar as dotstar
import time
# Turn off the one pixel connected internally! autoshow is on
idot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
idot[0] = (0, 0, 0)