Advertisement
muhsahlan

Testes

May 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #include <SPI.h>
  2. #include <ESP8266WiFi.h>
  3.  
  4. //SSID of your network
  5. char ssid[] = "Heu heu heu";
  6. //password of your WPA Network
  7. char pass[] = "siapakamu";
  8.  
  9.   int biru = 5;
  10.   int merah = 16;
  11.   int ijo = 4;
  12. void setup() {
  13.   // put your setup code here, to run once:
  14.   Serial.begin(9600);
  15.  
  16.   WiFi.begin(ssid, pass);
  17.  
  18.   Serial.print("Connecting");
  19.   while(WiFi.status() != WL_CONNECTED){
  20.     Serial.print(".");
  21.     delay(500);
  22.     }
  23.   pinMode(biru, OUTPUT);
  24.   pinMode(ijo, OUTPUT);
  25.   pinMode(merah, OUTPUT);
  26.  
  27.   Serial.println();
  28.   // if you are connected, print out info about the connection:
  29. }
  30.  
  31. void loop() {
  32.   long rssi = WiFi.RSSI();
  33.   Serial.print("RSSI:");
  34.   Serial.println(rssi);
  35.  
  36.   delay(1000);
  37.   // put your main code here, to run repeatedly:
  38.   digitalWrite(biru, HIGH);
  39.   delay(1000);
  40.   digitalWrite(merah, HIGH);
  41.   delay(1000);
  42.   digitalWrite(biru, LOW);
  43.   delay(1000);
  44.   digitalWrite(ijo, HIGH);
  45.   delay(1000);
  46.   digitalWrite(merah, LOW);
  47.   delay(1000);
  48.   digitalWrite(ijo, LOW);
  49.   delay(1000);
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement