This file contains hidden or 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 pinnumbers [] = {2,3,4,5,6,7,8,9,10,11,12,13} | |
| for (int i= 0; i++; i<12) | |
| { | |
| pinMode(pinnumbers[i],OUTPUT); | |
| } |
This file contains hidden or 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
| #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(); |
This file contains hidden or 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
| #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); |
This file contains hidden or 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
| // 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 |
This file contains hidden or 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
| float circlearea (float radius) | |
| { | |
| float result = 0; | |
| result = 3.141592654 * radius * radius; | |
| return result; | |
| } |
This file contains hidden or 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
| area2 = circlearea(radius2); |
This file contains hidden or 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
| // 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() | |
| { |
This file contains hidden or 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
| // 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() |
This file contains hidden or 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
| // 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() | |
| { |
This file contains hidden or 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
| /* | |
| 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 |