Skip to content

Instantly share code, notes, and snippets.

View dniklaus's full-sized avatar

Dieter Niklaus dniklaus

View GitHub Profile
@dniklaus
dniklaus / lintilla-embedded-getdist
Created September 9, 2014 18:24
Lintilla.Embedded: get distance to obstacle in front of the robot, as an enhancment of processEchoServer
else if ('d' == ch)
{
unsigned long obstacle = 0;
client.print(F("Obstacle in Front of Lintilla Robot ID="));
if (0 != ultrasonicSensorFront)
{
obstacle = ultrasonicSensorFront->getDistanceCM();
if (UltrasonicSensor::DISTANCE_LIMIT_EXCEEDED == obstacle)
{
client.print(F("infinite"));
@dniklaus
dniklaus / lintilla-rest
Last active August 29, 2015 14:06
REST API functions
//---------------------------------------------------------------------------
// REST Server
//---------------------------------------------------------------------------
// ...
// REST API function declarations
int test(String command); // test
int stop(String command); // stop
int move(String command); // move
@dniklaus
dniklaus / LcdKeypad.ino
Last active August 29, 2015 14:13
LcdKeypad Example Sketch
// Timer library, https://github.com/dniklaus/arduino-utils-timer
#include <Timer.h>
#include <TimerAdapter.h>
#include <TimerContext.h>
#include <UptimeInfo.h>
#include <LiquidCrystal.h>
// LcdKeypad, https://github.com/dniklaus/arduino-display-lcdkeypad
@dniklaus
dniklaus / AnUltrasonicSensorAdapter.h
Created January 29, 2015 00:01
Header File for an example implementation of AnUltrasonicSensorAdapter (see https://github.com/dniklaus/arduino-driver-ultrasonicranging)
/*
* AnUltrasonicSensorAdapter.h
*
* Created on: 30.07.2014
* Author: niklausd
*/
#ifndef ANULTRASONICSENSORADAPTER_H_
#define ANULTRASONICSENSORADAPTER_H_
@dniklaus
dniklaus / AnUltrasonicSensorAdapter.cpp
Created January 29, 2015 00:02
Source File for an example implementation of AnUltrasonicSensorAdapter (see https://github.com/dniklaus/arduino-driver-ultrasonicranging)
/*
* AnUltrasonicSensorAdapter.cpp
*
* Created on: 30.07.2014
* Author: niklausd
*/
#include "Arduino.h"
#include "CmdSequence.h"
#include <AnUltrasonicSensorAdapter.h>
@dniklaus
dniklaus / MultipleTimerExample.ino
Last active April 19, 2018 08:55
This Arduino Sketch demonstrates the Timer library usage when multiple timers have to run concurrently.
/**
* This Arduino Sketch demonstrates the Timer library usage when multiple timers have to run concurrently.
* The Timer library can be along with its documentation can be found here:
* [wiring-timer](https://github.com/dniklaus/wiring-timer)
*/
#include <Timer.h>
void func30s();
void func45s();
@dniklaus
dniklaus / ArduinoTest.cpp
Last active November 22, 2015 17:00
Eclipse Arduino Plugin test sketch
#include "arduino.h"
#include "Timer.h" // https://github.com/dniklaus/arduino-utils-timer
#include "ToggleButton.h" // https://github.com/dniklaus/arduino-toggle-button
const int cBlnkStatBtn = ToggleButton::BTN_NC;
const int cBlnkStatInd = ToggleButton::IND_NC;
const int cBlnkLed = LED_BUILTIN;
const unsigned long cBlinkTimeMillis = 200;
ToggleButton* blinkStatus = 0;
Timer* blinkTimer = 0;
/**
* Micro-Professor MPF-1 Tape File generator based on Arduino.
*
* Arduino Sketch: MPF_1_TapeFileGen
*
* 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.
@dniklaus
dniklaus / AdafruitPWMServoDriverTest.ino
Last active March 23, 2016 13:43
This is an Adafruit 16-channel PWM & Servo driver Servo test - this will drive 16 servos, one after the other.
/***************************************************
This is an example for our Adafruit 16-channel PWM & Servo driver
Servo test - this will drive 16 servos, one after the other
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
@dniklaus
dniklaus / mqtt_huzzah.ino
Created March 24, 2016 01:35
Adafruit HUZZAH ESP8266 Board, MQTT application for IoF (Internet of Fish)
/*
Adafruit HUZZAH ESP8266 Board, MQTT application for IoF (Internet of Fish)
To install the HUZZAH board, (using Arduino 1.6.4+):
- Add the following 3rd party board manager under "File -> Preferences -> Additional Boards Manager URLs":
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Open the "Tools -> Board -> Board Manager" and click install for the ESP8266"
- Select your ESP8266 in "Tools -> Board"
PubSubClient GitHub repository can be found here: https://github.com/knolleary/pubsubclient