Electoday 2025

ของเล่นใหม่ => Internet of Things : LoRa LoRaWAN NB-IoT eMTC => Topic started by: JENG on August 12, 2014, 01:45:30 PM

Title: ลองเล่น App Inventor 2
Post by: JENG on August 12, 2014, 01:45:30 PM
รายละเอียดคงต้องรอช่วงว่างคับ ช่วงนี้เล่นเอามันส์ งานหลักยังรออีกหลายงาน วันนี้ลงทุนซื้อ smart phone ใหม่
เพื่อเอามาเล่นโดยเฉพาะ ;D เริ่มติดใจ เพราะคิดว่าต่อยอดงานที่ทำอยู่ได้อีกเยอะแยะ เพิ่งได้เล่นครั้งแรกรู้สึกว่ามันง่าย
ประกอบกับข้อมูลและตัวอย่างค่อนข้างเยอะ เลยไม่ต้องดำน้ำเอง


อันแรกเล่นกับ bluetooth
http://www.youtube.com/v/KYKyv0edsvc


(http://image.free.in.th/v/2013/ip/140812125502.jpg) (http://picture.in.th/id/274f942d5750712d9a5e14f5ea281d47)


(http://image.free.in.th/v/2013/io/140812125651.jpg) (http://picture.in.th/id/4bdc6891044ab34219c0a7d9ec91f5a2)


BlueControl.APK
Download (https://drive.google.com/file/d/0B77_GeSXdC6rbWZrZHY4ODFUbnc/edit?usp=sharing)


Arduino source code
int LED = 13;
String readString;

void setup()
{
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
}

void loop()
{
  while(Serial.available())
  {
    delay(3);
    char c = Serial.read();
    readString += c;
  }
 
  if(readString.length() > 0)
  {
    Serial.println(readString);
    if(readString == "on")
    {
      digitalWrite(LED, HIGH);
    }
    if(readString == "off")
    {
      digitalWrite(LED, LOW);
    }
    readString = "";
  }
}
Title: Re: ลองเล่น App Inventor 2
Post by: S.poolpong93 on August 12, 2014, 05:27:58 PM
น่าสนๆ  มาแอบเก็บความรู้ แฮ่ๆ

ก่อนหน้านี้ ที่มอผมก็มีอบรมเรื่องนี้ แต่ผมดันติดงาน ไม่ได้ไปอบรมเลย มีไฟล์คล้ายๆเป็น Example  เผื่อใครอยากเอาไปศึกษาครับ
https://drive.google.com/#folders/0ByZPjLeuf6hOZFlQX0gxTG15Snc (https://drive.google.com/#folders/0ByZPjLeuf6hOZFlQX0gxTG15Snc)
Title: Re: ลองเล่น App Inventor 2
Post by: JENG on August 14, 2014, 08:59:54 AM

http://www.youtube.com/v/BC6IV-eMirw


(http://image.free.in.th/v/2013/ih/140814085050.jpg) (http://picture.in.th/id/206c0217bc32021475bcbc66dfacdc77)


(http://image.free.in.th/v/2013/ia/140814085150.jpg) (http://picture.in.th/id/ee4453a1048039a35a8eeef2e4000889)


(http://image.free.in.th/v/2013/ie/140814085228.jpg) (http://picture.in.th/id/5fa62705ba2e4933c2b319ca33d93fbd)


EthernetControl.APK
Download (https://drive.google.com/file/d/0B77_GeSXdC6rS2gyOXREbFNPTWc/edit?usp=sharing)


Arduino source code
/*
Author   :Mr.Somlak Mangnimit (Mangnimit.Mcu)
Date     :13/08/2014
H/W      :Arduino UNO + Ethernet Shield
*/


#include <SPI.h>
#include <Ethernet.h>


EthernetServer server(5200);// Server port


const byte ledPin = A0;// Select pin for Main Light


byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,177);


String readString;


//----------------------------------------
//
//----------------------------------------
void setup()
{
  delay(300);
  pinMode(ledPin, OUTPUT);
  Serial.begin(57600);
 
  // start the Ethernet connection:
  Serial.println("Trying to get an IP address using DHCP");
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // initialize the ethernet device not using DHCP:
    Ethernet.begin(mac, ip);
  }
 
  // print your local IP address:
  Serial.print("My IP address: ");
  ip = Ethernet.localIP();
  for (byte thisByte = 0; thisByte < 4; thisByte++) {
    //  print the value of each byte of the IP address:
    Serial.print(ip[thisByte], DEC);
    Serial.print(".");
  }
  Serial.println();
  // start listening for clients
  server.begin();
}


//----------------------------------------
//
//----------------------------------------
void loop()
{
  EthernetClient client = server.available();// Create a client connection
  if (client == true)
  {
    while (client.connected())
    {
      if (client.available())
      {
        char c = client.read();// Read char by char HTTP request
       
        if (readString.length() < 100)
        {
          readString = readString + c;// Store characters to string
        }
       
        if (c == '\n')
        {
          Serial.println(readString);
          client.println(F("http/1.1 200 ok"));// Send standard http headers
          client.println(F("content-type: text/html"));
          client.println();
          client.println(F("<!doctype html><html>"));
          client.println(F("<center><head><title>Home Web Control</title></head>"));
          client.println(F("<h2>Arduino UNO R3 Ethernet Shield Web Server</h2>"));
          client.println(F("<h2>www.electoday.com</h2>"));
          client.print(F("<input type=button value='LED ON' onmousedown=location.href='/?led_on'>"));
          client.println(F("<input type=button value='LED OFF' onmousedown=location.href='/?led_off'><br/><br/>"));
          client.println(F("</body></html>"));
          delay(1);// Page loading delay
          client.stop();// Stopping client
          if(readString.indexOf("/?led_on") > 0) digitalWrite(ledPin, HIGH);
          if(readString.indexOf("/?led_off") > 0) digitalWrite(ledPin, LOW);
          readString = "";// Clearing string for next read
        }
      }
    }
  }
}


Title: Re: ลองเล่น App Inventor 2
Post by: sitthisak2024 on August 14, 2014, 09:17:12 AM
App Inventor 2    มันเอาใว้สร้าง แอป.ใน สมาร์ทโฟน หรือครับ?  ถ้าใช่... มันสร้างแอปที่ สมาร์ทโฟน แล้วรันได้เลย หรือว่า ต้องลงในคอม. ก่อน สร้างเสร็จ ค่อยเอาแอปที่สร้างไปลงใน สมาร์ทโฟน
Title: Re: ลองเล่น App Inventor 2
Post by: JENG on August 14, 2014, 10:34:36 AM
Quote from: sitthisak2024 on August 14, 2014, 09:17:12 AM
App Inventor 2  มันเอาใว้สร้าง แอป.ใน สมาร์ทโฟน หรือครับ?  ถ้าใช่... มันสร้างแอปที่ สมาร์ทโฟน แล้วรันได้เลย หรือว่า ต้องลงในคอม. ก่อน สร้างเสร็จ ค่อยเอาแอปที่สร้างไปลงใน สมาร์ทโฟน

ใช่คับ จะ build เป็น apk ลง com หรือจะ build ส่ง link เป็น QR แล้วเอา smart phone โหลดแล้วลงเลยก็ได้
หรือจะ emu สดๆผ่าน wifi โดยใช้ MIT AI2 ก็ได้เช่นกัน

Title: Re: ลองเล่น App Inventor 2
Post by: amaloma on August 15, 2014, 11:36:54 AM
นาสนใจครับ
Title: Re: ลองเล่น App Inventor 2
Post by: suriya22 on August 15, 2014, 04:55:33 PM
คุณ Jeng ได้โทรศัพท์ใหม่ด้วย ยินดีด้วยครับ ผมคงต้องหาเรื่องทำอย่างนี้บ้าง ถึงจะอนุมัติซื้อเครื่องใหม่ได้ อิอิ
Title: Re: ลองเล่น App Inventor 2
Post by: karn@kasin on August 15, 2014, 10:42:51 PM
ปีที่แล้วจัดทำโครงการหุ่นยนต์เตะฟุตบอลผ่านมือถือ เชื่อมต่อกับโมดูลบูลทูธ ครับ ผมก็ใช้ app inventor ครับ สะดวกดี
ใช้เวลาเรียนรู้ไม่นานครับ
Title: Re: ลองเล่น App Inventor 2
Post by: JENG on August 21, 2014, 11:54:23 AM

http://www.youtube.com/v/t7OC_s1uErc


(http://image.free.in.th/v/2013/ik/140821114327.jpg) (http://picture.in.th/id/78138feba256361f0158ad0c1e38b7e3)


(http://image.free.in.th/v/2013/id/140821114408.jpg) (http://picture.in.th/id/beb5187b5edaf7c410509a94f1fdd7ca)


ServoControl.APK
Download (https://drive.google.com/file/d/0B77_GeSXdC6rTDhXRW9WTDEyYlU/edit?usp=sharing)


arduino source code
/*
Author  :Mr.Somlak Mangnimit
Date    :21/08/2014
H/W     :Arduino UNO + Bluetooth HC-06
*/


#include <Servo.h>


Servo servo;


int serial_val;


//--------------------
void setup(void)
//--------------------
{
  Serial.begin(9600);
  Serial.setTimeout(5);
  servo.attach(9);
}


//--------------------
void loop(void)
//--------------------
{
  if(Serial.available()>0)
  {
    serial_val = Serial.parseInt();
    if(serial_val >=0 && serial_val <=180)
    {
      servo.write(serial_val);
      Serial.println(serial_val);
    }
  }
}
Title: Re: ลองเล่น App Inventor 2
Post by: Maxza757 on September 01, 2015, 10:12:34 PM
ขอโทษนะครับพี่ ขา RX//TX ของHC-05 ต่อที่ขาไหนของ Nano หรอครับ??
Title: Re: ลองเล่น App Inventor 2
Post by: abhinant on September 05, 2015, 02:36:43 PM
น่าสนใจต้องเอาไปลองเล่นบ้างแล้ว
Title: Re: ลองเล่น App Inventor 2
Post by: satcons on October 04, 2015, 12:33:57 PM
น่าสนใจดีครับ  :D
Title: Re: ลองเล่น App Inventor 2
Post by: RDA on October 04, 2015, 02:28:40 PM
ตัวนี้ใช้งานง่ายเหมาะสำหรับผุ้เริ่มต้น