Skip to main content

Posts

Showing posts with the label arduino

wifi robot control using NodeMCU

Belajar IoT - Menyalakan dan Mematikan Lampu Via Internet Menggunakan AgnosThings dan ESP8266

Internet of Things kian marak. Perangkat IoT yang murah meriah dan canggih sudah banyak dan akan terus bermunculan. Berbagai layanan platform IoT pun semakin berkembang dan saling berkompetisi. Ekosistem yang semakin meluas ini berdampak pada membludaknya jumlah penggiat IoT untuk membuat berbagai kreasi. Vision Mobile dalam salah satu reportnya menyebutkan bahwa pada hingga penghujung tahun 2015 ada sekitar 4,5 juta individu developer aktif di seluruh dunia yang mengembangkan perangkat IoT. Pada tutorial ini, Saya akan menunjukkan satu kasus implementasi IoT yang dapat Kamu coba dengan tingkat kesulitan yang rendah dan budget yang ekonomis. Skenarionya adalah membuat perangkat yang dapat menyalakan dan mematikan lampu melalui komputer atau handphone yang terhubung ke internet. Kalo Kamu belum punya gambaran tentang IoT atau Internet of Things, Kamu bisa baca ulasan tentang gambaran umum IoT pada artikel Penjelasan Sederhana mengenai Internet of Things atau CodePolitan Magazine ed

Cara membuat program simple Arduino HMC5883L

  /*  HMC5883L Triple Axis Digital Compass. Simple Example.  Read more: http://www.jarzebski.pl/arduino/czujniki-i-sensory/3-osiowy-magnetometr-hmc5883l.html  GIT: https://github.com/jarzebski/Arduino-HMC5883L  Web: http://www.jarzebski.pl  (c) 2014 by Korneliusz Jarzebski */ #include < Wire . h > #include < HMC5883L . h > HMC5883L compass ; void setup ( ) {   Serial . begin ( 9600 ) ;   // Initialize HMC5883L   Serial . println ( "Initialize HMC5883L" ) ;   while ( ! compass . begin ( ) )   {     Serial . println ( "Could not find a valid HMC5883L sensor, check wiring!" ) ;     delay ( 500 ) ;   }     // Set measurement range   // +/- 0.88 Ga: HMC5883L_RANGE_0_88GA   // +/- 1.30 Ga: HMC5883L_RANGE_1_3GA (default)   // +/- 1.90 Ga: HMC5883L_RANGE_1_9GA   // +/- 2.50 Ga: HMC5883L_RANGE_2_5GA   // +/- 4.00 Ga: HMC5883L_RANGE_4GA   // +/- 4.70 Ga: HMC5883L_RANGE_4_7GA   // +/- 5.60 Ga: HMC5883L_RAN

Program Arduino Virtual Color Mixer

/*  This example reads three analog sensors (potentiometers are easiest) and sends their values serially. The Processing and Max/MSP programs at the bottom take those three values and use them to change the background color of the screen. The circuit: * potentiometers attached to analog inputs 0, 1, and 2 http://www.arduino.cc/en/Tutorial/VirtualColorMixer created 2 Dec 2006 by David A. Mellis modified 30 Aug 2011 by Tom Igoe and Scott Fitzgerald  This example code is in the public domain. */ const int redPin = A0 ; // sensor to control red color const int greenPin = A1 ; // sensor to control green color const int bluePin = A2 ; // sensor to control blue color void setup ( ) {   Serial . begin ( 9600 ) ; } void loop ( ) {   Serial . print ( analogRead ( redPin ) ) ;   Serial . print ( "," ) ;   Serial . print ( analogRead ( greenPin ) ) ;   Serial . print ( "," ) ;   Serial . println ( analo

Program While Statment Conditional pada Arduino

/*  Conditionals - while statement This example demonstrates the use of  while() statements. While the pushbutton is pressed, the sketch runs the calibration routine. The  sensor readings during the while loop define the minimum and maximum of expected values from the photo resistor. This is a variation on the calibrate example. The circuit: * photo resistor connected from +5V to analog in pin 0 * 10K resistor connected from ground to analog in pin 0 * LED connected from digital pin 9 to ground through 220 ohm resistor * pushbutton attached from pin 2 to +5V * 10K resistor attached from pin 2 to ground created 17 Jan 2009 modified 30 Aug 2011 by Tom Igoe modified 20 Jan 2017 by Arturo Guadalupi This example code is in the public domain. http://www.arduino.cc/en/Tutorial/WhileLoop */ // These constants won't change: const int sensorPin = A0 ;        // pin that the sensor is attached to const int ledPin = 9 ;      

Program Display Bar Graph dengan menggunakan Arduino

/*  LED bar graph  Turns on a series of LEDs based on the value of an analog sensor.  This is a simple way to make a bar graph display. Though this graph  uses 10 LEDs, you can use any number by changing the LED count  and the pins in the array.  This method can be used to control any series of digital outputs that  depends on an analog input.  The circuit:   * LEDs from pins 2 through 11 to ground created 4 Sep 2010 by Tom Igoe This example code is in the public domain. http://www.arduino.cc/en/Tutorial/BarGraph */ // these constants won't change: const int analogPin = A0 ;    // the pin that the potentiometer is attached to const int ledCount = 10 ;     // the number of LEDs in the bar graph int ledPins [ ] = {   2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 } ;    // an array of pin numbers to which LEDs are attached void setup ( ) {   // loop over the pin array and set them all to output:   for ( int