Function( )
Upcoming SlideShare
Loading in...5
×
 

Function( )

on

  • 74 views

A basic presentation to help understand concept of Function in terms of programming and especially in Arduino environment.

A basic presentation to help understand concept of Function in terms of programming and especially in Arduino environment.

Statistics

Views

Total Views
74
Views on SlideShare
74
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Function( ) Function( ) Presentation Transcript

  • Function( ) Riken Patel Hardware Prototyping Workshop [10-13 Feb, 2014] IDC, IIT Bombay
  • make_tea( *le number of cup ) { Take * glass of milk Add * spoon tea-leaf …… … Function Makes our task easy Template to do certain task }
  • make_tea(2) { Take 2 glass of milk Add 2 spoon tea-leaf …… … Function Makes our task easy Template to do certain task }
  • make_tea(7) { Take 7 glass of milk Add 7 spoon tea-leaf …… … Function Makes our task easy Template to do certain task }
  • make_tea(70) { Take 70 glass of milk Add 70 spoon tea-leaf …… … Function Makes our task easy Template to do certain task }
  • make_tea(777); :) Function Makes our task easy Template to do certain task
  • play(*Game name, *number of players); Function Makes our task easy Template to do certain task
  • play(cards, 5); play(carom, 3); play(chinese_checkers, 2); ……. Function Makes our task easy Template to do certain task …….
  •  Digital I/O  Analog I/O  Time  Math &Trigonometry Functions in Arduino  Interrupts  Communication
  • pinMode(); pinMode(*pin_number, INPUT/OUTPUT);  Configures the specified pin to behave either as an input or an output. Digital I/O
  • digitalRead(); int a=digitalRead(pin)  Reads the value from a specified digital pin, either HIGH or LOW & returns a value. Digital I/O digitalWrite(); digitalWrite(pin,value)  Write a HIGH or a LOW value to a digital pin.
  • analogRead(); int a= analogRead(pin) Reads the value from a specified digital pin, either HIGH or LOW. Analog I/O analogWrite() analogWrite(pin, value) Writes an analog value (0-255 PWM wave) to a pin..
  • delay(); delay(1000); Pauses the program for the amount of time (in miliseconds) Time millis() double a=millis(); Returns the number of milliseconds since the Arduino board began running the current program.
  • int a= min(x, y); min() Maths & Trigonometry sin() max() cos() abs() tan() constrain() map() pow() sqrt()
  • map(value, fromLow, fromHigh, toLow, toHigh) Percentage=map(marks,0,500,0,100); Maths & Trigonometry .
  • interrupts() noInterrupts() attachInterrupt() detachInterrupt() Interrupts
  • Serial() Communication