Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import notecard
from notecard import hub
from periphery import I2C
import cv2
import keys
import time
from picamera2 import Picamera2
from smbus2 import SMBus
from bme280 import BME280
#include <wiringPi.h>
int main(void)
{
int time = 100;
wiringPiSetup();
pinMode(7, OUTPUT);
pinMode(0, OUTPUT);
pinMode(2, OUTPUT);
for(;;)
{
@idreamsi
idreamsi / test.ino
Last active September 3, 2019 16:30
UTF-8 test with u8g2
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
@idreamsi
idreamsi / ESP8266-SoftAP-WebServer.ino
Created February 7, 2019 07:46
ESP8266 example: Wi-Fi Access point, static IP, web-server and remote GPIO control
/* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
IPAddress apIP(42, 42, 42, 42); // Defining a static IP address: local & gateway
// Default IP in AP mode is 192.168.4.1
/* This are the WiFi access point settings. Update them to your likin */
const char *ssid = "ESP8266";
@idreamsi
idreamsi / eeprom_rw_test.ino
Created December 1, 2018 16:25 — forked from t3db0t/eeprom_rw_test.ino
Arduino EEPROM Read-Write Example
/******************************************************
Arduino EEPROM Read-Write Test
by Ted Hayes 2012
[email protected]
Demonstrates the usage of the EEPROM Library for checking the state of a single value,
changing it, and resetting it. To use:
1) Put a momentary switch between ground and pin 11 on your Arduino.
@idreamsi
idreamsi / BasicHttpClient.ino
Last active May 20, 2018 17:15
Control ESP8266 Builtin LED via HTTP
//Control ESP8266 Builtin LED via HTTP
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#define USE_SERIAL Serial
ESP8266WiFiMulti WiFiMulti;
@idreamsi
idreamsi / image_matrix.py
Created May 20, 2018 14:54 — forked from vgmoose/image_matrix.py
Creates a C array from a bitmap file
import json
import sys
import os
print ".--=============--------------=============--."
print "| Welcome to Image Matrix Maker! |"
print ".--=============--------------=============--."
yeswords = ["yes", "y", "ya", "ok", "okay"]
#include <SPI.h>
const int slaveSelectPin = D8;
uint8_t buffer[16][16][3] = { 0 };
unsigned long step = 0;
//------------------demos------------------------
void gradient(uint8_t x, uint8_t y, unsigned long step) {
@idreamsi
idreamsi / LCD_Game.ino
Created January 15, 2017 16:43 — forked from dadecoza/LCD_Game.ino
Side scrolling one button jump game for the Arduino LCD Keypad shield.
/* Modified slightly to work with the LCD Keypad Shield.
* Original - http://www.instructables.com/id/Arduino-LCD-Game/
*/
#include <LiquidCrystal.h>
#define SPRITE_RUN1 1
#define SPRITE_RUN2 2
#define SPRITE_JUMP 3
#define SPRITE_JUMP_UPPER '.' // Use the '.' character for the head
#define SPRITE_JUMP_LOWER 4
@idreamsi
idreamsi / HowToOTGFast.md
Created August 1, 2016 15:54 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Finally, open up the cmdline.txt. Be careful with this file, it is very picky with its formatting! Each parameter is seperated by a single