This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a = np.array([1,2,3]) | |
print a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "YOUR NETWORK SSID"; | |
const char* password = "PASSWORD"; | |
int wifiStatus; | |
void setup() { | |
Serial.begin(9600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float temp; | |
int tempPin = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
temp = analogRead(tempPin); | |
temp = temp * 0.48828125; //convert into celcius |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() | |
{ | |
pinMode (2, INPUT); | |
pinMode (3, OUTPUT); | |
} | |
void loop() | |
{ | |
if (digitalRead(2)== 1) | |
{ | |
digitalWrite(3, HIGH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() | |
{ | |
TRISB = 0x00; // Sets all pins in PORTB as output | |
PORTB = 0b00000001; // Set RB0 to high 00000001 | |
TRISA = 0x00; // Sets all pins in PORTB as output | |
PORTA = 0b00000000; // Set RB0 to high 00000001 | |
CMCON = 0x07; // To turn off comparators | |
ADCON1 =0x06; //Turne off adc | |
do // To set infinite loop | |
{ |
OlderNewer