Skip to content

Instantly share code, notes, and snippets.

View boxalljohn's full-sized avatar

John Boxall boxalljohn

View GitHub Profile
int pinnumbers [] = {2,3,4,5,6,7,8,9,10,11,12,13}
for (int i= 0; i++; i<12)
{
pinMode(pinnumbers[i],OUTPUT);
}
@boxalljohn
boxalljohn / brick1
Last active December 19, 2015 18:18
#include <LiquidCrystal.h> // we need this library for the LCD commands
LiquidCrystal lcd(10,11,12,13,14,15,16);
float noisy = 0;
void setup()
{
lcd.begin(16, 2); // need to specify how many columns and rows are in the LCD unit
lcd.println("tronixstuff! ");
lcd.setCursor(0,1);
delay(2000);
lcd.clear();
#include <LiquidCrystal.h>
// we need this library for the LCD commands
LiquidCrystal lcd(10,11,12,13,14,15,16);
void setup()
{
lcd.begin(16, 2); // tells Arduino the LCD dimensions
lcd.setCursor(0,0);
lcd.print("Hello electropus!");
// print text and move cursor to start of next line
lcd.setCursor(0,1);
// example 3.1
void setup()
{
pinMode (2, OUTPUT); // set pin 2 as an output pin
}
void loop()
{
for (int i = 1; i<=20; i++) // loop 20 times
float circlearea (float radius)
{
float result = 0;
result = 3.141592654 * radius * radius;
return result;
}
area2 = circlearea(radius2);
// Example 3.3 – servo examination
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
int del = 100; // delay in micoseconds
void setup()
{
// Example 3.2 – interrupts
#include <LiquidCrystal.h> // we need this library for the LCD commands
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
float noisy = 0;
void setup()
// Example 3.3 – servo examination
#include "Servo.h"
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
int del = 100; // delay in micoseconds
void setup()
{
/*
Arduino demo sketch using Peter H. Anderson serial LCD chip - http://www.phanderson.com
by John Boxall - http://tronixstuff.wordpress.com - 19/04/2010
*/
float noisy = 0;
void setup()
{
Serial.begin(2400); // am using 2400bps serial LCD chip, therefore this line is required
randomSeed(analogRead(0)); // reseed the random number generator with some noise