#include <EEPROM.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
readEEPROM();
}
void loop() {
}
// put your main code here, to run repeatedly:
void readEEPROM() {
int value =0;
int addr = 0;
value = EEPROM.read(addr);
while (value != 0) {
Serial.print(value);
addr = addr + 1;
value = EEPROM.read(addr);
}
Serial.println();
}
Dept.of Engineering Education (Electronic Engineering) @King Mongkut's Ladkrabang (KMITL), BKK Thailand Advanced Flight Student (FS3) in International Virtual Aviation Organisation™ (IVAO)
Sunday, November 30, 2014
Thursday, November 27, 2014
Thursday, November 20, 2014
0000
int led1 = 2;
int led2 = 3;
int led3 = 4;
int sw = 8;
void setup() {
// put your setup code here, to run once:
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(sw, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int swInput = digitalRead(sw);
if (swInput == ' '){
digitalWrite (led1,HIGH);
digitalWrite (led2,LOW);
digitalWrite (led3,LOW);
} else {
(swInput == ' ');
digitalWrite (led1,LOW);
digitalWrite (led2,LOW);
digitalWrite (led3,LOW);
}
}
int led2 = 3;
int led3 = 4;
int sw = 8;
void setup() {
// put your setup code here, to run once:
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(sw, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int swInput = digitalRead(sw);
if (swInput == ' '){
digitalWrite (led1,HIGH);
digitalWrite (led2,LOW);
digitalWrite (led3,LOW);
} else {
(swInput == ' ');
digitalWrite (led1,LOW);
digitalWrite (led2,LOW);
digitalWrite (led3,LOW);
}
}
Exam2
int led1 = 2;
int led2 = 3;
int sw1 = 7;
int sw2 = 8;
int time = 100;
int count = 0;
int s = LOW;
int a;
int old = HIGH;
void setup() {
// put your setup code here, to run once:
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(sw7,INPUT);
pinMode(sw8,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(sw1)==LOW && digitalRead(sw2)==HIGH ){
for(int i = 1;i <= 3;i++){
digitalWrite(led1,!s);
delay(time);
digitalWrite(led1,LOW);
digitalWrite(led2,!s);
delay(time);
digitalWrite(led2,LOW);
if(digitalRead(sw2)==LOW && digitalRead(sw1)==HIGH){
time = time + 100;
}
i = 1;
}
}
}
int led2 = 3;
int sw1 = 7;
int sw2 = 8;
int time = 100;
int count = 0;
int s = LOW;
int a;
int old = HIGH;
void setup() {
// put your setup code here, to run once:
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(sw7,INPUT);
pinMode(sw8,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(sw1)==LOW && digitalRead(sw2)==HIGH ){
for(int i = 1;i <= 3;i++){
digitalWrite(led1,!s);
delay(time);
digitalWrite(led1,LOW);
digitalWrite(led2,!s);
delay(time);
digitalWrite(led2,LOW);
if(digitalRead(sw2)==LOW && digitalRead(sw1)==HIGH){
time = time + 100;
}
i = 1;
}
}
}
Wednesday, November 19, 2014
arduino-lcd-alarm-clock
http://fritzing.org/projects/arduino-lcd-alarm-clock/
Thursday, November 13, 2014
Exam
#define LED_PIN 13
int DT = 2000;
void setup() {
pinMode(LED_PIN,OUTPUT);
Serial.begin(9600);
Serial.println("Please select: \n + - increase_speed \n - - decrease_speed");
}
void loop() {
char inp;
if(Serial.available() > 0){
inp = Serial.read();
if (inp == '+') {
DT = DT + 200;
}
else if (inp == '-'){
DT = DT+ - 200;
} else{
DT = 2000;
}
}
digitalWrite(LED_PIN, HIGH);
delay(DT);
digitalWrite(LED_PIN, LOW);
delay(DT);
}
int DT = 2000;
void setup() {
pinMode(LED_PIN,OUTPUT);
Serial.begin(9600);
Serial.println("Please select: \n + - increase_speed \n - - decrease_speed");
}
void loop() {
char inp;
if(Serial.available() > 0){
inp = Serial.read();
if (inp == '+') {
DT = DT + 200;
}
else if (inp == '-'){
DT = DT+ - 200;
} else{
DT = 2000;
}
}
digitalWrite(LED_PIN, HIGH);
delay(DT);
digitalWrite(LED_PIN, LOW);
delay(DT);
}
Wednesday, November 12, 2014
Monday, November 10, 2014
.include "D:\4th years\INTRODUCTION TO VERY LARGE SCALE INTEGRATED\necessary file\morbn20.md"
VDD VDD GND 5
VA A GND BIT ({00001111}) AC 5
VB B GND BIT ({00110011}) AC 5
VCin Cin GND BIT ({01010101}) AC 5
.tran/op 1n 80n method=bdf
.print tran v(A) v(B) v(Cin) v(Sum) v(Cout)
VDD VDD GND 5
VA A GND BIT ({00001111}) AC 5
VB B GND BIT ({00110011}) AC 5
VCin Cin GND BIT ({01010101}) AC 5
.tran/op 1n 80n method=bdf
.print tran v(A) v(B) v(Cin) v(Sum) v(Cout)
Subscribe to:
Posts (Atom)