Skip to content

Instantly share code, notes, and snippets.

import numpy as np
a = np.array([1,2,3])
print a
#include <ESP8266WiFi.h>
const char* ssid = "YOUR NETWORK SSID";
const char* password = "PASSWORD";
int wifiStatus;
void setup() {
Serial.begin(9600);
/****Libraries required****/
#include <ESP8266WiFi.h> //ESP8266 main library
#include <ESP8266WebServer.h> //Library to handle Web Server commands
const char *ssid = "ESP8266"; //Name of the Access Point
const char *password = "12345678"; //Password of the Access Point
/****Define a web server at port 80 for HTTP****/
ESP8266WebServer server(80); // Use port 443 for HTTPS
void setup()
{
pinMode(13, OUTPUT); // Pin 13 has an LED connected on most Arduino boards
pinMode(2,INPUT); //Pin 2 is connected to the output of proximity sensor
}
void loop()
{
if(digitalRead(2)==HIGH) //Check the sensor output
{
digitalWrite(13, HIGH); // set the LED on
float temp;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125; //convert into celcius
void setup()
{
pinMode (2, INPUT);
pinMode (3, OUTPUT);
}
void loop()
{
if (digitalRead(2)== 1)
{
digitalWrite(3, HIGH);
const int leftForward = 2;
const int leftBackward = 3;
const int rightForward = 4;
const int rightBackward = 5;
void setup()
{
pinMode(leftForward , OUTPUT);
pinMode(leftBackward , OUTPUT);
pinMode(rightForward , OUTPUT);
pinMode(rightBackward , OUTPUT);
#include <Servo.h> // Include the Servo library
int servoPin = 3; // Declare the Servo pin
Servo Servo1; // Create a servo object
void setup() {
Servo1.attach(servoPin); // We need to attach the servo to the used pin number
}
void loop(){
Servo1.write(0); // Make servo go to 0 degrees
delay(1000);
Servo1.write(90); // Make servo go to 90 degrees
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second