Skip to content

Instantly share code, notes, and snippets.

@netmaniac
netmaniac / env_station.ino
Created April 16, 2014 20:33
Sending POST requests to ThingSpeak channel from Arduino YUN
#include <Bridge.h>
#include <Console.h>
#include <Process.h>
#include <DHT.h>
DHT dht;
#define Vref 4.95
#define ARRAY_SIZE 4
//https://github.com/nettigo/RadioNRF24
#include <SPI.h>
#include <RadioNRF24.h>
#define BUFF_SIZE 40
struct Payload {
byte id;
unsigned long data;
#define NOT_CORRECTED 10
/*
Change brightness of LED linearly to Human eye
32 step brightness using 8 bit PWM of Arduino
brightness step 24 should be twice bright than step 12 to your eye.
*/
#include <avr/pgmspace.h>
#define CIELPWM(a) (pgm_read_word_near(CIEL8 + a)) // CIE Lightness loopup table function
@netmaniac
netmaniac / error_message.txt
Created February 25, 2016 07:55
Problem with error 'void value not ignored as it ought to be' in Arduino IDE 1.6.7
/home/viciu/akd-sketchbook/not_ignored_void/tab2.ino: In function 'void setup()':
tab2:3: error: void value not ignored as it ought to be
Serial.println("2+2=4");
^
exit status 1
void value not ignored as it ought to be
//****************************************************************
/*
Watchdog Sleep Example
Demonstrate the Watchdog and Sleep Functions
Photoresistor on analog0 Piezo Speaker on pin 10
KHM 2008 / Lab3/ Martin Nawrath nawrath@khm.de
Kunsthochschule fuer Medien Koeln
Academy of Media Arts Cologne
#include <SPI.h>
#include "Battery.h"
#include <Radio.h>
#include "PinChangeInterrupt.h"
//#include <TinyDebugSerial.h>
//TinyDebugSerial debug = TinyDebugSerial();
#define BUTTON 10
#define PHOTOCELL_PWR 9
@netmaniac
netmaniac / i2c_lcd.py
Created October 19, 2016 09:12
Simple lib for PCF8574 based I2C LCD adapters
#!/usr/bin/python
# Supports 16x2 and 20x4 screens.
#
# Based on work by Matt Hawkins (raspberrypi-spy.co.uk)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@netmaniac
netmaniac / nova_sensor.py
Last active August 10, 2022 17:32
Nova SDS011 sensor. Code is free to use in own projects, but I don't provide any support nor don't make me liable if it is not working :)
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import serial, time, struct, array
from datetime import datetime
ser = serial.Serial()
ser.port = "/dev/ttyUSB0" # Set this to your serial port
ser.baudrate = 9600
/*
24-02-2017 http://nettigo.pl Fixes to get it working on current Arduino IDE based on work:
3-2-2011 Spark Fun Electronics 2011 Nathan Seidle
Not all options are working. For sure works: Hello World, change background black/white,
Dull boy,both barcode examples and bitmap.
To use this example code, attach
Arduino : Printer