Team Updates

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
const char *ssid = "Temp:355,Humid.:66.2";
const char *password = "password";
ESP8266WebServer server(80);
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
byte numSsid = WiFi.scanNetworks();
Serial.println(numSsid);
}
void loop() {
server.handleClient();
}
view raw nodeMCUWifi.ino hosted with ❤ by GitHub
#include <DHT.h>
DHT sensor(2, DHT22);
int Flame = A2;
void setup() {
sensor.begin();
pinMode(Flame, INPUT_PULLUP);
Serial.begin(9600);
pinMode(4, OUTPUT);
}
void loop() {
int R = analogRead(Flame);
Serial.println(R);
if (R <= 800) {
digitalWrite(4, HIGH);
delay(500);
digitalWrite(4, LOW);
}
Serial.print("Temperature: ");
Serial.println( sensor.readTemperature(true) );
Serial.print("Humidity: ");
Serial.println( sensor.readHumidity() );
delay(500);
}
marko_manMarco
iSpyFire App Demo
iSpyFire App Demo
starchaserx5Kyle Benalcazar
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.IOException;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.filechooser.FileSystemView;
import javax.swing.JOptionPane;
import java.awt.image.BufferStrategy;
import java.awt.font.*;
public class Fire
{
public static void main(String[] args)
{
JFrame f = new JFrame();
int temp = 950;
int humidity = 15;
int loc_x = 23;
int loc_y = 45;
f.setTitle("My App");
//set background
BufferStrategy bufferStrategy;
// Graphics2D graphic = (Graphics2D) bufferStrategy.getDrawGraphics();
// graphic.setBackground(Color.GREEN);
// graphic.fillRect(0, 0, 400, 700);
f.setPreferredSize(new Dimension(400,750));
JPanel last_panel = new JPanel();
JPanel panel = new JPanel();
JOptionPane popup = new JOptionPane();
panel.setLayout(new BorderLayout());
JPanel btn_panel = new JPanel();
// panel.setBackground(Color.red);
JPanel firstPanel = new JPanel();
JTextArea Textarea;
Textarea = new JTextArea(50,50);
Textarea.setEditable(true);
Textarea.setLineWrap(true);
Textarea.append("The Authorities Have Been Contacted \n");
Textarea.append("Warning! Fire hazard nearby. \nWARN OTHERS IMMEDIATELY \n" );
Textarea.append("Temperature: " + temp + " F\n");
Textarea.append("Humidity: " + humidity+" %\n");
Textarea.append("Location: " + loc_x + ", " + loc_y+"\n");
Textarea.setBackground(Color.black);
Textarea.setFont(new Font("Verdana", Font.BOLD, 16));
Textarea.setForeground(Color.RED);
JButton btn1 = new JButton ("Things to do");
panel.add(Textarea,BorderLayout.NORTH);
panel.setPreferredSize(new Dimension(350,150));
btn_panel.add(btn1, BorderLayout.EAST);
last_panel.add(panel, BorderLayout.NORTH);
//picturer
ImageIcon image;
JPanel Image_pal = new JPanel(new BorderLayout());
JLabel mapLabel;
image = new ImageIcon("Fires.png");
Image scaleImage = image.getImage().getScaledInstance(380,500,Image.SCALE_DEFAULT);
image = new ImageIcon(scaleImage);
mapLabel = new JLabel(image);
Image_pal.add(mapLabel,BorderLayout.CENTER);
last_panel.add(mapLabel,BorderLayout.SOUTH);
last_panel.add(btn_panel,BorderLayout.SOUTH);
class MyListerner implements ActionListener
{
@Override
public void actionPerformed(ActionEvent e)
{
if (e.getSource()== btn1)
{
popup.showMessageDialog(btn1, " Things to do immediately:" +"\n" +
"-Let's people near you know there is a growing WILD FIRE in the Area ! "+ "\n"
+"-Let fire hazard apartment know about it Call 911" +"\n"
+"-Stay away from the fire and get somewhere safe");
}
}
};
MyListerner listener1 = new MyListerner();
btn1.addActionListener(listener1);
last_panel.setBackground(new Color(107,106,104));
f.add(last_panel);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
}
starchaserx5Kyle Benalcazar
Flame Detector!
Flame Detector!
marko_manMarco
Heat and Humidity Sensor!
Heat and Humidity Sensor!
marko_manMarco
NASA Logo

SpaceApps is a NASA incubator innovation program.