Saturday, July 22, 2023

CODES

31
2

project-7ab87f">





#define BLYNK_PRINT Serial    
#include <SPI.h> 
#include <ESP8266WiFi.h> 
#include <BlynkSimpleEsp8266.h> 
#include <SimpleTimer.h> 
#include <DHT.h> 
#define BLYNK_PRINT Serial 
#include <OneWire.h> 
#include <DallasTemperature.h> 
#define ONE_WIRE_BUS D2 
OneWire oneWire(ONE_WIRE_BUS); 
DallasTemperature sensors(&oneWire); 
 
char auth[] ="----------------";               //Authentication code sent by Blynk 
char ssid[] = "-------";                       //WiFi SSID 
char pass[] = "-------";                       //WiFi Password 
 
#define sensorPin D3  
int sensorState = 0; 
int lastState = 0; 
#define DHTPIN 2     
#define DHTTYPE DHT11      
DHT dht(DHTPIN, DHTTYPE); 
SimpleTimer timer; 
void sendSensor() 
  float h = dht.readHumidity(); 
  float t = dht.readTemperature(); 
 
  if (isnan(h) || isnan(t)) { 
    Serial.println("Failed to read from DHT sensor!"); 
    return; 
  } 
  
  Blynk.virtualWrite(V5, h);  //V5 is for Humidity 
  Blynk.virtualWrite(V6, t);  //V6 is for Temperature 
void setup() 
  Serial.begin(9600); 
  Blynk.begin(auth, ssid, pass); 
   pinMode(sensorPin, INPUT); 
  dht.begin(); 
 
  timer.setInterval(1000L, sendSensor); 
  Serial.begin(115200); 
  Blynk.begin(auth, ssid, pass); 
   sensors.begin(); 
int sensor=0; 
void sendTemps() 
sensor=analogRead(A0); 
sensors.requestTemperatures(); 
float temp = sensors.getTempCByIndex(0);  
Serial.println(temp); 
Serial.println(sensor); 
Blynk.virtualWrite(V1, temp); 
Blynk.virtualWrite(V2,sensor); 
delay(1000); 
void loop() 
  Blynk.run();  
  timer.run();  
  sendTemps(); 
  sensorState = digitalRead(sensorPin); 
Serial.println(sensorState); 
 
if (sensorState == 1 && lastState == 0) { 
  Serial.println("needs water, send notification"); 
  Blynk.notify("Water your plants"); 
  lastState = 1; 
  delay(1000); 
//send notification 
     
  }  
  else if (sensorState == 1 && lastState == 1) { 
    //do nothing, has not been watered yet 
  Serial.println("has not been watered yet"); 
  delay(1000); 
  } 
  else { 
    //st 
    Serial.println("does not need water"); 
    lastState = 0; 
    delay(1000); 
  } 
   
  delay(100); 






Sunday, May 14, 2023

Basic of Stocks ...

Getting Started with Stock Trading

Getting Started with Stock Trading

It can be intimidating to start trading stocks, but it doesn't have to be! To start, familiarize yourself with the fundamentals and various investment methods by reading up on them.

Next, make some goals depending on your level of comfort with risk and your desires for your financial future.

Open an account with a broker you like and trust after doing some research on them.

Then, begin assembling a portfolio of equities that fit your objectives and risk appetite.

Watch your investments carefully, and be ready to change your plan if required.

Keep in mind that the stock market can be unpredictable, but with a little perseverance and self-control, you could possibly see some fantastic profits!

Additional Tips:

  1. Start with a small investment amount and gradually increase as you gain experience.
  2. Use a diverse approach by investing in different industries or sectors to mitigate risk.
  3. Stay informed about market trends and news that can impact stock prices.
  4. Consider using stop-loss orders to limit potential losses.
  5. Understand the concept of "buy and hold" strategy for long-term investing.
  6. Learn about different order types, such as market orders and limit orders.
  7. Keep emotions in check and avoid making impulsive decisions based on short-term market fluctuations.
  8. Consider seeking advice from a financial advisor or joining investment communities to learn from experienced traders.
  9. Continuously educate yourself by reading books, attending seminars, or taking online courses on stock trading.
  10. Monitor and evaluate your performance regularly to learn from your successes and failures.

Written by - Shourya

Hashtags: #StockTrading #Investing #FinancialGoals #PortfolioManagement