Powerful Electronics With by : Abdallah Hodieb Twitter :@TheNightPhoenix
Small Computers on a single integrated circuit containing ●A processor core ●Memory ●I/O devices Some of the most used types: ●Atmel AVR ●Microchip PIC Microcontrollers
What do you need to program a Microcontroller ●Microcontroller Chip ●Prototyping Board ●Corresponding Burner / Development Kit ●Compiler ●Optionally IDE
What is Arduino Arduino is an Open Source electronics prototyping platform based on easy to use hardware and software.
Why is Arduino so popular ●Open Source ●IDE works on Linux , Macs, and Windows ●Tons of Libraries ●Tons of shields , accessories , sensors and modules ●Low cost ●Simple and Attractive
Tech Specs
Lets Start Hacking ! First Download IDE / Compiler from : ●Ubuntu Software Center ●Online : http://arduino.cc/en/Main/Software Optionally Download Fritzing (Electronics Designer) ●http://fritzing.org/
Hello World Application void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); // set the LED on delay(1000); // wait for a second digitalWrite(13, LOW); // set the LED off delay(1000); // wait for a second }
Hello World cont. ●setup() ●loop() ●pinMode() ●digitalWrite() ●delay()
Sound The Alarm ( Digital ) int ledPin = 9; int alarmPin = 10; void setup() { pinMode(ledPin, OUTPUT); pinMode(alarmPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); digitalWrite(alarmPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); digitalWrite(alarmPin, LOW); delay(1000); }
Sound The Alarm ( PWM ) //PWM: 3, 5, 6, 9, 10, and 11. int ledPin = 9; int alarmPin = 10; void setup() { } void loop() { for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=20) { analogWrite(ledPin, fadeValue); analogWrite(alarmPin,fadeValue); delay(30); } for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=20) { analogWrite(ledPin, fadeValue); analogWrite(alarmPin,fadeValue); delay(30); } }
Make It Interactive int alarm = LOW; int val; void setup() { Serial.begin(9600); Serial.flush(); } void loop() { if(Serial.available()) { val = Serial.read(); Serial.println(val); if (val == 'A') alarm = HIGH; else alarm = LOW; } if (alarm) { Alarm(); } else { analogWrite(ledPin,0); analogWrite(alarmPin,0); } } import serial import time sp = '/dev/ttyACM0' ser = serial.Serial(sp,9600) seconds = 0.0 while seconds < 10: ser.write('A') time.sleep(.8) seconds += .8
Extra Step ●Install gnome-alarm ●set an alarm to 'Sound the Alarm !'
Questions
Where to Buy : Online Local Electronics Stores http://ram-e-shop.com/ http://egyrobots.com/ http://www.fut-electronics.com/

Powerful Electronics with Arduino

  • 1.
    Powerful Electronics With by: Abdallah Hodieb Twitter :@TheNightPhoenix
  • 2.
    Small Computers ona single integrated circuit containing ●A processor core ●Memory ●I/O devices Some of the most used types: ●Atmel AVR ●Microchip PIC Microcontrollers
  • 3.
    What do youneed to program a Microcontroller ●Microcontroller Chip ●Prototyping Board ●Corresponding Burner / Development Kit ●Compiler ●Optionally IDE
  • 4.
    What is Arduino Arduinois an Open Source electronics prototyping platform based on easy to use hardware and software.
  • 5.
    Why is Arduinoso popular ●Open Source ●IDE works on Linux , Macs, and Windows ●Tons of Libraries ●Tons of shields , accessories , sensors and modules ●Low cost ●Simple and Attractive
  • 6.
  • 7.
    Lets Start Hacking! First Download IDE / Compiler from : ●Ubuntu Software Center ●Online : http://arduino.cc/en/Main/Software Optionally Download Fritzing (Electronics Designer) ●http://fritzing.org/
  • 8.
    Hello World Application voidsetup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); // set the LED on delay(1000); // wait for a second digitalWrite(13, LOW); // set the LED off delay(1000); // wait for a second }
  • 9.
  • 10.
    Sound The Alarm( Digital ) int ledPin = 9; int alarmPin = 10; void setup() { pinMode(ledPin, OUTPUT); pinMode(alarmPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); digitalWrite(alarmPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); digitalWrite(alarmPin, LOW); delay(1000); }
  • 11.
    Sound The Alarm( PWM ) //PWM: 3, 5, 6, 9, 10, and 11. int ledPin = 9; int alarmPin = 10; void setup() { } void loop() { for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=20) { analogWrite(ledPin, fadeValue); analogWrite(alarmPin,fadeValue); delay(30); } for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=20) { analogWrite(ledPin, fadeValue); analogWrite(alarmPin,fadeValue); delay(30); } }
  • 12.
    Make It Interactive intalarm = LOW; int val; void setup() { Serial.begin(9600); Serial.flush(); } void loop() { if(Serial.available()) { val = Serial.read(); Serial.println(val); if (val == 'A') alarm = HIGH; else alarm = LOW; } if (alarm) { Alarm(); } else { analogWrite(ledPin,0); analogWrite(alarmPin,0); } } import serial import time sp = '/dev/ttyACM0' ser = serial.Serial(sp,9600) seconds = 0.0 while seconds < 10: ser.write('A') time.sleep(.8) seconds += .8
  • 13.
    Extra Step ●Install gnome-alarm ●setan alarm to 'Sound the Alarm !'
  • 14.
  • 15.
    Where to Buy: Online Local Electronics Stores http://ram-e-shop.com/ http://egyrobots.com/ http://www.fut-electronics.com/