Skip to content

Instantly share code, notes, and snippets.

View willhooi's full-sized avatar

William Hooi Yuk Chuan willhooi

View GitHub Profile
@willhooi
willhooi / Paul walker.ino
Last active June 29, 2022 16:48
Arduino insect bot
// /////////////////////////////////////////////////////////////////
// INSECT BOT
// based on https://www.instructables.com/id/Insect-Bot-mini/
//
// modified by Lumi for DFRobot.com
// 2013/10/26
//
// modified by William Hooi using HC-SR04
// pin assignments:
// Front servo: pin 9, Rear servo: pin 10
/*CLAUDIA Cloud lamp v2 code (27 May 2018)
Contributed by William H /OneMaker Group
based on modified codes by Alex(Super Make Something)
with synth sounds code idea by Alessandro Contini + Alberto Massa
and samples by Adafruit Neopixel tutorial
*/
#include <Adafruit_NeoPixel.h>
#define PIN 6 //define neopixel pin number
@willhooi
willhooi / gist:d36c9602806445de1ec5772b1b515310
Created February 5, 2018 23:29
Sample code for Grove sound sensor
const int pinAdc = A0;
void setup()
{
Serial.begin(115200);
}
void loop()
{
long sum = 0;
/* Ultrasonic Servo Rover 'Eric'
* Contributed by William Hooi
*
* Adapted from MAEP 2.0 Navigation project by Noah Moroze, aka GeneralGeek
* This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
* PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
*/
#include <Servo.h> //include Servo library
/*Motion Following Pet Robot aka Molly for NLB
* Using HC-SR04 ultrasonic with Arduino
* Contributed by: William Hooi/OneMaker Group 2018
* Inspired and based on code by Calvin Kielas-Jensen
*/
#include <Servo.h>
int LrangeOut = 10, LrangeIn = 11, RrangeOut=12, RrangeIn = 13 ;
//Ltrigger =10;Lecho=11;Rtrigger=12;Recho=13
int servo =9, threshold=25;
/* Cloud Lamp Programming Workshop
* Contributed by William Hooi/OneMaker Group Pte Ltd
* Based on examples provided by Adafruit NeoPixel tutorial
*
*/
#include <Adafruit_NeoPixel.h>
#define PIN 6 //define pin number
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
@willhooi
willhooi / Ultrasonic Servo Rover
Last active November 9, 2018 03:46
Roving bot made with ultrasonic sensor with 2 continuous servo motors
/* Ultrasonic Servo Rover 'Jack'
* Contributed by William Hooi
*
* Adapted from MAEP 2.0 Navigation project by Noah Moroze, aka GeneralGeek
* This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
* PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
* Ultrsonic pins: trigger->pin 4, echo->pin5
* Continuous servo motor: left-> pin 6, right-> pin 7
*/
@willhooi
willhooi / mollow.ino
Created January 10, 2018 07:51
Motion following code for MollowBot
/* Motion Following Pet Robot aka MollowBot
* Using Grove kit & sensors
* Conttributed by: William Hooi / OneMaker Group 2018
* Inspired and based on motion follow robot by Calvin Kielas-Jensen
*/
#include <Servo.h>
#include <Ultrasonic.h>
Servo fServo;
@willhooi
willhooi / EspressoLiteWorkshopPlus
Created April 3, 2017 06:44
Arduino sketch for Espresso Lite Workshop Plus
// #include <Arduino.h>
#include <ESPert.h>
#include <Servo.h>
ESPert espert;
Servo myservo;
const char* mqtt_server = "mqtt.espert.io";
#include <ESPert.h>
ESPert espert;
//String smartphone_key = "xxxxxxxxxxxx"; //replace with your smartphone key
const char *host = "www.espert.io";
const char* mqtt_server = "mqtt.espert.io";
int pirPin = 14;
int LED = 15;
int relay= 4;