1 / 14

Embedded

Embedded. Sumo 1T4 – 1T5 UTRA. What is Arduino?. Image Source: http ://arduino.cc/en/uploads/Main/ArduinoUno_r2_front450px.jpg. Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects . - arduino.cc.

zyta
Download Presentation

Embedded

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded Sumo 1T4 – 1T5 UTRA

  2. What is Arduino? Image Source: http://arduino.cc/en/uploads/Main/ArduinoUno_r2_front450px.jpg

  3. Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects. - arduino.cc Image Source: http://arduino.cc/en/uploads/Main/ArduinoDiecimilaComponents.jpg

  4. Micro-controller: ATMega328-PU Image Source: http://d1gsvnjtkwr6dd.cloudfront.net/large/IC-ATMEGA328-PU_LRG.jpg

  5. Aruidno IDE • C-like programming language • One-button upload • Come with example code

  6. Select board Select Port Setup the IDE Port number can be found in “Device Manager” from “Control Panel”

  7. /* Blink Turns on an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the documentation at http://arduino.cc This example code is in the public domain. modified 8 May 2014 by Scott Fitzgerald */ Example: Blinking LED

  8. voidsetup(){ pinMode(13, OUTPUT); } voidloop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); } Example: Blinking LED

  9. voidsetup(){ … } This function runs only once after boot-up or after you pressed the reset button. Hence the name “setup”. This function sets pin 13 as “output”, meaning you can set it to either “high” (5V) or “low” (0V). pinMode(13, OUTPUT); voidloop() { … } Example: Blinking LED This function runs over and over again forever.

  10. This command turns the LED on (by making a 5V output). digitalWrite(13, HIGH); delay(1000); Sleep for 1 second. The unit for this function is millisecond (ms) and 1000 ms = 1s. Example: Blinking LED digitalWrite(13, LOW); This command turns the LED off (by making the output 0V, which is the same as ground).

  11. voidsetup(){ pinMode(13, OUTPUT); } voidloop() { digitalWrite(13, HIGH); // LED on for 1 second delay(1000); digitalWrite(13, LOW); // LED off for 1 second delay(1000); } // repeat (back to the beginning of loop) Example: Blinking LED

  12. voidsetup(){ Serial.begin(9600); } voidloop() { intsensorValue=analogRead(A0); Serial.println(sensorValue); delay(1000); } // repeat (back to the beginning of loop) Example: Analog & Serial

  13. This command starts the serial communication between Arduino and the host PC at a specific baud rate. In this case, 9600. Serial.begin(9600); analogRead(A0); This command reads the voltage input at A0 and translate the number into a value between 0 and 1023. Example: Analog & Serial Serial.println(sensorValue); This command prints the value of the variable to the serial terminal in the Arduino IDE.

  14. Click to open the serial terminal Inputs (from PC to Arduino) Outputs (from Arduino to PC) Serial Terminal Select the correct baud rate

More Related