Difference between revisions of "WeMOS: AnalogRead"

From OnnoWiki
Jump to navigation Jump to search
(Created page with " #include <Wire.h> #include <TM1650.h> TM1650 d; void setup() { Wire.begin(); //Join the bus as master Serial.begin(115200); //Start serial communication at 960...")
 
 
Line 1: Line 1:
 +
==Code==
 +
 +
/////////////////////////////////
 +
// Generated with a lot of love//
 +
// with TUNIOT FOR ESP8266    //
 +
// Website: Easycoding.tn      //
 +
/////////////////////////////////
 +
 +
void setup()
 +
{
 +
  Serial.begin(115200);
 +
}
 +
 +
void loop()
 +
{
 +
    Serial.println(analogRead(A0));
 +
    delay(1000);
 +
}
 +
 +
 +
 +
==Code dengan 7 segmen==
 +
 +
 +
 
  #include <Wire.h>
 
  #include <Wire.h>
 
  #include <TM1650.h>
 
  #include <TM1650.h>
Line 21: Line 46:
 
   delay(500);
 
   delay(500);
 
  }
 
  }
 +
 +
 +
==Pranala Menarik==
 +
 +
* [[WeMOS]]

Latest revision as of 07:28, 9 November 2019

Code

/////////////////////////////////
// Generated with a lot of love//
// with TUNIOT FOR ESP8266     //
// Website: Easycoding.tn      //
/////////////////////////////////

void setup()
{
  Serial.begin(115200);
}

void loop()
{
    Serial.println(analogRead(A0));
    delay(1000);
}


Code dengan 7 segmen

#include <Wire.h>
#include <TM1650.h>

TM1650 d;

void setup() 
{
  Wire.begin(); //Join the bus as master
  Serial.begin(115200); //Start serial communication at 9600 for debug statements
  Serial.println("TM1650 Example Code");
  d.init();   
}

void loop() {
  int sensorReading = analogRead(A0);
  char buffer[5] = "    ";
  Serial.println(sensorReading);
  d.displayOn();
  d.setBrightnessGradually(TM1650_MAX_BRIGHT);
  d.displayString(itoa(sensorReading,buffer,10));
  delay(500);
}


Pranala Menarik