http nearfieldcommunication org http nfcforum org https el

  • Slides: 23
Download presentation

Πηγές • http: //nearfieldcommunication. org/ • http: //nfc-forum. org/ • https: //el. wikipedia. org/wiki/NFC

Πηγές • http: //nearfieldcommunication. org/ • http: //nfc-forum. org/ • https: //el. wikipedia. org/wiki/NFC

Make. Block - m. Bot

Make. Block - m. Bot

Τύποι Arduino

Τύποι Arduino

Arduino MEGA 2560

Arduino MEGA 2560

Επικοινωνία με τον υπολογιστή μέσω USB Κώδικας void setup() { Serial. begin(9600); } void

Επικοινωνία με τον υπολογιστή μέσω USB Κώδικας void setup() { Serial. begin(9600); } void loop() { Serial. println(“Hello World!”); delay(1000); } Serial Monitor

L. E. D. Blink Κώδικας int led = 13; void setup() { pin. Mode(led,

L. E. D. Blink Κώδικας int led = 13; void setup() { pin. Mode(led, OUTPUT); } void loop() { digital. Write(led, HIGH); delay(1000); digital. Write(led, LOW); delay(1000); } 1 KΩ

Aναλογική ανάγνωση Ποτενσιόμετρου Signal GND Κώδικας VCC int pot. Pin = A 0; int

Aναλογική ανάγνωση Ποτενσιόμετρου Signal GND Κώδικας VCC int pot. Pin = A 0; int value; void setup() { Serial. begin(9600); } void loop() { value = analog. Read(pot. Pin); Serial. println(value); delay(10); }

PWM = Pulse Width Modulation analog. Write(pin-name, value) ● υλοποιεί PWM αναθέτοντας το value

PWM = Pulse Width Modulation analog. Write(pin-name, value) ● υλοποιεί PWM αναθέτοντας το value στο dutycycle της παλμοσειράς. ● το value παίρνει τιμές 0 -255 (8 bit).

Έλεγχος φωτεινότητας Led μέσω Ποτενσιόμετρου με χρήση PWM int led. Pin = 13; Κώδικας

Έλεγχος φωτεινότητας Led μέσω Ποτενσιόμετρου με χρήση PWM int led. Pin = 13; Κώδικας int pot. Pin = A 0; int brightness; // 0 -255 (8 bit) int value; // 0 -1023 (10 bit) void setup(){ pin. Mode(led. Pin, OUTPUT); Serial. begin(9600); } void loop(){ value = analog. Read(pot. Pin); brightness = map(value, 0, 1023, 0, 255); analog. Write(led. Pin, brightness); Serial. println(value); }

Έλεγχος κινητήρα Servo Καφέ Κόκκινο Πορτοκαλί Κώδικας #include <Servo. h> Servo myservo; int servo.

Έλεγχος κινητήρα Servo Καφέ Κόκκινο Πορτοκαλί Κώδικας #include <Servo. h> Servo myservo; int servo. Pin = 9; int pos = 0; // 0 -180 degrees void setup() { myservo. attach(servo. Pin); } void loop() { for (pos = 0; pos <= 180; pos++){ myservo. write(pos); delay(15); } for (pos = 180; pos >= 0; pos--) { myservo. write(pos); delay(15); } }