This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LED Fadeing Example (PWM) http://arduino.cc/en/Reference/AnalogWrite | |
void setup() { | |
pinMode(5, OUTPUT); | |
pinMode(6, OUTPUT); | |
pinMode(7, OUTPUT); //NO PWM | |
pinMode(8, OUTPUT); //NO PWM | |
pinMode(9, OUTPUT); | |
pinMode(10, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensorValue; | |
// the setup routine runs once when you press reset: | |
void setup() { | |
// initialize serial communication at 9600 bits per second: | |
Serial.begin(9600); | |
Spark.variable("light", &sensorValue, INT); | |
} | |
// the loop routine runs over and over again forever: | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Modified from SoftPWM library example at: https://code.google.com/p/rogue-code/wiki/SoftPWMLibraryDocumentation#Usage_Example | |
//SoftPWM library must be installed | |
//NF for Design & Technology at LWHS Dec 2014 (modification: added all D&T "sleepyBoard" lamp board pins) | |
//Explanation: On the D&T lamp boards, only pins 5, 6, 9, 10, and 11 (not 7, 8, or 12) are "PWM enabled" and work with | |
//the analogWrite function. Built into the hardware on those pins is a way to toggle very quickly between on | |
//and off, leading to a dimmer or brighter LED, depending on the ratio of "on" times to "off" times. | |
//However, it's possible to replicate this effect in software, which is what the SoftPWM Arduino library does. | |
//Challenge 1: can you made the LEDs fade at different rates? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Check for empty fields | |
if(empty($_POST['name']) || | |
empty($_POST['email']) || | |
empty($_POST['phone']) || | |
empty($_POST['message']) || | |
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) | |
{ | |
echo "No arguments Provided!"; | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$("input,textarea").jqBootstrapValidation({ | |
preventSubmit: true, | |
submitError: function($form, event, errors) { | |
// additional error messages or events | |
}, | |
submitSuccess: function($form, event) { | |
// Prevent spam click and default submit behaviour | |
$("#btnSubmit").attr("disabled", true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content="Andrew Kleindolph"> | |
<title>Number Fog Patterns</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//orignal code made by M Atkinson, please check his website http://www.multiwingspan.co.uk | |
//few minor modifications made by cronos_80@hotmail.com | |
#include <Wire.h> | |
#include "RTClib.h" | |
RTC_DS1307 RTC; | |
int datapin = 2; | |
int clockpin = 3; | |
int latchpin = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// called once on startup | |
void setup() { | |
// For simplicity, we'll format our weather data as text, and pipe it to serial. | |
// but you could just as easily display it in a webpage or pass the data to another system. | |
// Learn more about the serial commands at https://docs.particle.io/reference/firmware/photon/#serial | |
// for the Photon, or https://docs.particle.io/reference/firmware/core/#serial for the Core | |
// You can also watch what's sent over serial with the particle cli with | |
// particle serial monitor | |
Serial.begin(115200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//pin hookups: | |
//LCD TX = Photon TX | |
//LCD 5v = Photon Vin (with USB hooked up) will not operate on 3.3v | |
//LCD GND = Photon GND | |
#define lcd Serial1 | |
void setup() { | |
lcd.begin(9600); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------------------------------- | |
// Controlling LEDs over the Internet | |
// ----------------------------------- | |
// First, let's create our "shorthand" for the pins | |
// Same as in the Blink an LED example: | |
// led1 is D0, led2 is D7 | |
int led1 = D0; | |
int led2 = D7; |