Arduino.

Slides:



Advertisements
Similar presentations
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Advertisements

ARDUINO FRAMEWORK.
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Embedded Sumo 1T4 – 1T5 UTRA.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Cascade switching of an LED EAS 199B Winter 2013.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Microcontrollers, Microcomputers, and Microprocessors
Arduino libraries Datatekniker Udvidet hardware/software.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Anodo (+) Catodo (-) Esempi: Rosso _ Rosso – Nero- Nero + (Marrone) = 220 ohm Marrone – Nero – Nero – Marrone + (Marrone) = 1 Kohm Marrone – Nero- Nero.
Microcontroller basics Embedded systems for mortals.
Lecture 9: Introduction to Arduino Topics: Arduino Fundamentals, Bean Date: Mar 22, 2016.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
LAB1 TYWU. Devices Dip Switch (4 Switches) Triple Output LED (RGB) –Common Cathode.
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
:Blink Blink: Er. Sahil Khanna
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse-Width Modulation: Simulating variable DC output
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Hacking on Arduino George Patterson
physical computing .2 – Day 3
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Val Manes Department of Math & Computer Science
Microcontroller basics
Arduino Programming Part II
Microcontroller basics
UTA010 : Engineering Design – II
Sensors with Arduino A Microcontroller.
Cascade switching of an LED
Get Your Project Started with Arduino
European Robotic LABoratory
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Lecture 2-2: Arduino Programming
Arduino.
Въведение в Arduino.
Arduino Uno and sensors
Analog Input through POT
Introduction to Arduinos
Topics: Analog/Digital Read Relay control 7 segment control Buzzer
Arduino Application: Speed control of small DC Motors
Programming, Serial and Virtual Prototyping
Arduinoda Fonksiyon ve Interruplar
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Using Photoresistors with an Arduino
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Arduino UMBC IEEE Sekar Kulandaivel
Arduino Uno circuit basics
Setting up a basic program with Arduino
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Arduino

Clignotement d'une led : int led1 = 1; int temps = 500; void setup() { pinMode(led1 , OUTPUT); } void loop() digitalWrite(led1 , HIGH); delay(temps); digitalWrite(led1 , LOW); On choisie la led n°1 Période de clignotement Etat haut de la led (5V) Etat bas de la led (ground)

Boucle d'asservissement d'une MCC int omega_consigne ; int omega; float modulante; int kp = 1; int ki = 1; int vitesse_t1; int vitesse_t2; int integral_omega = 0; int flagtimer = 0; void setup() { pinMode(3, OUTPUT); delay(10); Serial.begin(9600); } void InterruptTimer2() // debut de la fonction d'interruption Timer2 void loop() analogWrite( 3, modulante); // analogWrite( 3, 90); omega = analogRead(A2); // mesuré avec la tachy omega_consigne = analogRead(A1); // envoyé avec le GBF integral_omega = integral_omega + (omega_consigne-omega)*0.05; if (integral_omega > 100){ integral_omega=100; if (integral_omega < -100 ){ integral_omega=-100;} modulante = kp*(omega_consigne - omega) + ki*integral_omega + 612; if (modulante<0) { modulante = 0; if (modulante > 1000){ modulante = 1000; Serial.println("\n sortie:"); Serial.println(modulante); Serial.println(" integrateur:"); Serial.println(integral_omega); Serial.println("mesure omega : "); Serial.println(omega); Serial.println(" mesure consigne"); Serial.println(omega_consigne); delay(300); Boucle d'asservissement d'une MCC

MPPT pour panneaux photovoltaïque : int sensorPinU = A2; int sensorPinI = A3; int pwmPin = 3;      // select the pin for the LED int Umes = 0;  // variable to store the value coming from the sensor int Imes = 0; double Pcalcul = 0; double Pcalculold = 0; int sens = 1; int Pwm=200; void setup() {   // declare the ledPin as an OUTPUT:   pinMode(pwmPin, OUTPUT);   delay(10);   Serial.begin(9600); } void loop() {   // read the value from the sensor:   Umes = analogRead(sensorPinU);   Imes = analogRead(sensorPinI);   Pcalcul = Umes*Imes;   if(Pcalcul>Pcalculold){     if(sens==1){       Pwm=Pwm+10;}       else{       Pwm=Pwm-10;       sens=-1;}}     else if(Pcalcul<Pcalculold){       if(sens==1)       Pwm=Pwm+10;       sens=1;}   }   if(Pwm<0)   Pwm=0;   if(Pwm>1000)   Pwm=1000;   Pcalculold=Pcalcul;   // turn the ledPin on   analogWrite(pwmPin, Pwm);   // stop the program for <sensorValue> milliseconds:   Serial.println("Valeur Pwm :");   Serial.println(Pwm);   Serial.println("  Tension : ");    Serial.println(Umes);     Serial.println("  Courant : ");      Serial.println(Imes);       Serial.println("  Puissance : ");        Serial.println(Pcalcul);   // stop the program for for <sensorValue> milliseconds:   delay(1000);

Structure println : int sign; void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { sign = analogRead(A2); Serial.println(sign); // put your main code here, to run repeatedly: delay(100);