บทความ

กำลังแสดงโพสต์จาก 2019

สรุป Blockchain technology

เทคโนโลยี Blockchain คืออะไร เทคโนโลยี Blockchain นั้นโดยพื้นฐานแล้วมันคือรูปแบบการเก็บข้อมูลในฐานข้อมูลของคอมพิวเตอร์แบบหนึ่ง ที่มีลักษณะคล้ายการเก็บข้อมูลแบบห่วงโซ่ที่ ข้อมูลจะถูกเก็บเป็น Block และร้อยเรียงด้วย Chain มันเป็นฐานข้อมูลสาธารณที่คล้ายๆกับ wikipedia ที่ใครๆสามารถแก้ไขได้ แต่อย่างไรก็ตาม หากจะอธิบายให้ลึกลงไปกว่านั้น Blockchain กับ Wikipedia ก็มีความแตกต่างกัน แม้ว่าสองสิ่งนี้ถูกรันอยู่บนเครือข่ายอินเทอร์เนตเหมือนกัน แต่วิกิพีเดียนั้นถูกสร้างอยู่บนระบบ World Wide Web (WWW) ซึ่งตั้งอยู่บนเซอเวอร์แบบที่ใช้กันทั่วไป โดยผู้ใช้งานที่มี permission (สิทธิ์ในการแก้ไขหรือดูบทความ) อยู่บนระบบนั้นๆสามารถที่จะแก้ไขหรือเปลี่ยนแปลงข้อมูลบนวิกิพีเดียที่เก็บอยู่บนเซอเวอร์ได้ หมายความว่าแม้เราจะเขียนข้อมูลลงไปบน Wikipedia แต่สุดท้ายแล้วผู้ที่มีอำนาจในการอนุมัติหรือเปลี่ยนแปลงเด็ดขาดกลับไม่ใช่เราที่เป็นเจ้าของข้อมูล และนั้นเท่ากับว่าอำนาจเด็ดขาดอยู่ที่ wikipedia เบื้องหลังของวิกิพีเดียนั้นก็เหมือนกับฐานข้อมูลส่วนกลางที่ถูกป้องกันอย่างแน่นหนา เฉกเช่นเดียวกับระบบคอมพิวเตอร์ของรัฐบาล ธน...

สรุป Artifical intelligence

ปัญญาประดิษฐ์  ( อังกฤษ :  artificial intelligence ) หรือ   เอไอ  ( AI ) หมายถึง ความฉลาด เทียมที่สร้างขึ้นให้กับสิ่งที่ไม่มีชีวิต ปัญญาประดิษฐ์เป็นสาขาหนึ่งในด้าน วิทยาการคอมพิวเตอร์ และ วิศวกรรม เป็นหลัก แต่ยังรวมถึงศาสตร์ในด้านอื่น ๆ อย่าง จิตวิทยา   ปรัชญา   หรือ ชีววิทยา   ซึ่งสาขาปัญญาประดิษฐ์เป็นการเรียนรู้เกี่ยวกับกระบวนการการคิด   การกระทำ   การให้เหตุผล การปรับตัว   หรือ การอนุมาน   และการทำงานของ สมอง   แม้ว่าดังเดิมนั้นเป็นสาขาหลักในวิทยาการคอมพิวเตอร์ แต่แนวคิดหลาย ๆ อย่างในศาสตร์นี้ได้มาจากการปรับปรุงเพิ่มเติมจากศาสตร์อื่น ๆ เช่น การเรียนรู้ของเครื่อง   นั้นมีเทคนิคการเรียนรู้ที่เรียกว่า   การเรียนรู้ต้นไม้ตัดสินใจ   ซึ่งประยุกต์เอาเทคนิคการ อุปนัย ของ จอห์น สจวร์ต มิลล์   นักปรัชญา ชื่อดังของ อังกฤษ   มาใช้ เครือข่ายประสาทเทียม ก็นำเอาแนวคิดของการทำงานของสมองของมนุษย์ มาใช้ในการแก้ปัญหา การแบ่งประเภท ของข้อมูล และแก้ปัญหาอื่น ๆ ทาง สถิติ   เช่น   การวิเคราะห์ความถดถอย หรือ ...

mini project arduino

รูปภาพ
code #include <Password.h> #include <Keypad.h>  Password password = Password( "0000" ); //password to unlock, can be changed const byte ROWS = 4; // Four rows const byte COLS = 3; // columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3'}, {'4','5','6'}, {'7','8','9'}, {'*','0','#'} }; // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins. byte rowPins[ROWS] = {8, 7, 6, 5 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins. byte colPins[COLS] = { 4, 3, 2 }; // Create the Keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){   pinMode(10, OUTPUT);    pinMode(11, OUTPUT);  //green light   pinMode(12, OUTPUT);  //red light      keypad.addEventListener(keypadEvent); //add an event listener for this keypad   } void loop(){...

MiniProject

รูปภาพ
MiniProject  อุปกรณ์ 1. PIC16F877A 2. IC 7 SEGMENT 7448 3. IC 7400 4. 7 SEGMENT  COMMON CATHODE 5. CRYSTAL 4MHz 6. CAPACITOR 22pF Code void main() {      unsigned char dice[]={0b00000001,0b00000010,0b00000011,0b00000100,0b00000101,0b00000110,0b00000111,0b00001000,0b00001001};      unsigned char i;      unsigned char Num[]= {0b00010000,0b00100000,0b00110000,0b01000000,0b01010000,0b01100000,0b01110000,0b10000000,0b10010000      ,0b00000001,0b00010001,0b00100001,0b00110001,0b01000001,0b01010001,0b01100001,0b01110001,0b10000001,0b10010001,0b00000010      ,0b00010010,0b00100010,0b00110010,0b01000010};      unsigned char a;      TRISB=0xFF;      TRISC=0;      TRISD=0;      PORTD=0;      PORTB =1;      while(1)      {   ...

mikro c 6

รูปภาพ
 ใบรายงานผลการปฏิบัติงาน Code PORTB = Hex(s%10); PORTD.F2 = 1; Delay_ms(10); PORTD.F2 = 0; PORTB = Hex((s/10)%10); PORTD.F1 = 1; Delay_ms(10); PORTD.F1 = 0; PORTB = Hex((s/100)%10); PORTD.F0 = 1; Delay_ms(10); PORTD.F0 = 0; unsigned int Hex(int a) { switch(a) { case 1: return 0x06; case 2: return 0x5B; case 3: return 0x4F; case 4: return 0x66; case 5: return 0x6D; case 6: return 0x7D; case 7: return 0x07; case 8: return 0x7F; case 9: return 0x6F; case 0: return 0x3F; } } ภาพจำลองการทำงานด้วยโปรแกรม Proteus อ้างอิง https://electrosome.com/matrix-keypad-pic-microcontroller/

mikro c5

รูปภาพ
   ใบรายงานผลการปฏิบัติงาน Code char readKeyboard() { unsigned int i = 0; for(i=0;i<4;i++) { if(i == 0) PORTB = 1; else if(i == 1) PORTB = 2; else if(i == 2) PORTB = 4; else if(i == 3) PORTB = 8; if(PORTB.F4) return findKey(i,0); if(PORTB.F5) return findKey(i,1); if(PORTB.F6) return findKey(i,2); if(PORTB.F7) return findKey(i,3); } return ' '; } char findKey(unsigned short a, unsigned short b) { if(b == 0) { if(a == 3) return '0'; else if(a == 2) return '1'; else if(a == 1) return '2'; else if(a == 0) return '3'; } else if(b == 1) { if(a == 3) return '4'; else if(a == 2) return '5'; else if(a == 1) return '6'; else if(a == 0) return '7'; } else if(b == 2) { if(a == 3) return '8'; else if(a == 2) return '9'; else if(a == 1) return 'A'; else if(a == 0) r...

mikro c 4

รูปภาพ
    ใบรายงานผลการปฏิบัติงาน Code sbit LCD_RS at RB4_bit ; sbit LCD_EN at RB5_bit ; sbit LCD_D4 at RB0_bit ; sbit LCD_D5 at RB1_bit ; sbit LCD_D6 at RB2_bit ; sbit LCD_D7 at RB3_bit ;   sbit LCD_RS_Direction at TRISB4_bit ; sbit LCD_EN_Direction at TRISB5_bit ; sbit LCD_D4_Direction at TRISB0_bit ; sbit LCD_D5_Direction at TRISB1_bit ; sbit LCD_D6_Direction at TRISB2_bit ; sbit LCD_D7_Direction at TRISB3_bit ; unsigned int adcvalue , value , temp_res ; unsigned char car , x , y ; char * voltage = "00.00" ; long temp ;   // Routine to show the value of the ADC_read void ShowADC ( int x , int y , unsigned int adcvalue ) { car = adcvalue / 1000 ; LCD_Chr ( x , y , 48 + car ) ; adcvalue = adcvalue - 1000 * car ; car = ( adcvalue / 100 ) ; LCD_Chr_CP ( 48 + car ) ; adcvalue = adcvalue - 100 * car ; car = ( adcvalue / 10 ) ; LCD_Chr_CP ( 48 + car ) ; adcvalue = adcvalue - 10 * car ; car = adcvalue ; LCD_Chr_CP ( 48 + c...

mikro c 3

รูปภาพ
                 ใบรายงานผลการปฏิบัติงาน Code unsigned int i; unsigned int duty_50; void main(){ ADPCFG = 0xFFFF; // initialize AN pins as digital PORTB = 0xAAAA; TRISB = 0; // initialize portb as output Delay_ms(1000); duty_50 = PWM1_MC_Init(5000, 0, 0x01, 0); // Pwm_Mc_Init returns 50% of the duty PWM1_MC_Set_Duty(i = duty_50, 1); PWM1_MC_Start(); do { i--; PWM1_MC_Set_Duty(i, 1); Delay_ms(10); if (i == 0) i = duty_50 * 2 - 1; // Let us not allow the overflow PORTB = i; } while(1); ภาพจำลองการทำงานด้วยโปรแกรม Proteus อ้างอิง http://download.mikroe.com/documents/compilers/mikroc/dspic/help/pwm_motor_library.htm

mikro c 2

รูปภาพ
    ใบรายงานผลการปฏิบัติงาน Code void main() { TRISB.F0 = 0; //Makes PORTB0 or RB0 Output Pin while(1) //Infinite Loop { PORTB.F0 = 1; //LED ON Delay_ms(1000); //1 Second Delay PORTB.F0 = 0; //LED OFF Delay_ms(1000); //1 Second Delay } } ภาพจำลองการทำงานด้วยโปรแกรม Proteus vอ้างอิง https://electrosome.com/led-blinking-pic/

mikro c 1

รูปภาพ
              ใบรายงานผลการปฏิบัติงาน Code // LCD module connections sbit LCD_RS at RC2_bit; sbit LCD_EN at RC3_bit; sbit LCD_D4 at RC4_bit; sbit LCD_D5 at RC5_bit; sbit LCD_D6 at RC6_bit; sbit LCD_D7 at RC7_bit; sbit LCD_RS_Direction at TRISC2_bit; sbit LCD_EN_Direction at TRISC3_bit; sbit LCD_D4_Direction at TRISC4_bit; sbit LCD_D5_Direction at TRISC5_bit; sbit LCD_D6_Direction at TRISC6_bit; sbit LCD_D7_Direction at TRISC7_bit; // End LCD module connections void main() { Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,1,"Hello World");//Write text'Hello World' in first row } ภาพจำลองการทำงานด้วยโปรแกรม Proteus อ้างอิง https://electrosome.com/lcd-pic-interfacing/

arduino 16

รูปภาพ
              ใบรายงานผลการปฏิบัติงาน Code #include <Stepper.h>     //  การอ่านไฟล์จากไดเร็กทอรี หรือโฟลเดอร์ที่กำหนดไว้ #include "Keypad.h"  #define STEP_ANGLE_4STEP 32 //360/11.25 degree    //    ใช้เพื่อตั้งชื่อค่าคงที่ #define STEP_OUT_WITH_GEAR 2048 //32*64 Stepper stepper(STEP_ANGLE_4STEP,8,10,9,11); char keys[4][4]={    // เก็บข้อมูลที่  หน่วยความจำ  1  ไบต์   {'7','8','9','A'},   {'4','5','6','B'},   {'1','2','3','C'},   {'*','0','#','D'}}; byte rowPins[] = {7,6,5,4}; byte colPins[] = {3,2,1,0}; int speedmotor = 400;    / /  ตัวแปรพื้นฐานที่เก็บตัวเลขโดยไม่มีจุดทศนิยม int dirmotor = 1; Keypad keypad = Keypad(makeKeymap(keys),rowPins,colPins,4,4); //ฟังก์ของkeypad void setup()      //  ฟังก์ชั่นใช้ในการประกาศค่าเริ่มต้น   { } void loop()   //  ฟังก์ชั่นใช้ในการเขียนโค้ดโปรแกรมการทำงานของ...

arduino 15

รูปภาพ
                ใบรายงานผลการปฏิบัติงาน Code #include <LedControl.h>      //  การอ่านไฟล์จากไดเร็กทอรี หรือโฟลเดอร์ที่กำหนดไว้ #include <DHT11.h>     int pin=4;        / /  ตัวแปรพื้นฐานที่เก็บตัวเลขโดยไม่มีจุดทศนิยม DHT11 dht11(pin);   //ฟังก์ชั่นพิเศษของ   DHT11.h LedControl lc=LedControl(8,10,9,1);     //ฟังก์ชั่นของ lcd void show2digit(int h,int t)    // การเขียนฟังชั่นขึ้นมาโดยตั้งชื่อว่า  show2digit {    int seg1,seg2,seg3,seg4;   seg1 = h%10;   seg2 = h/10;   lc.setDigit(0,4,seg1,false);    lc.setDigit(0,5,seg2,false);   seg3 = t%10;   seg4 = t/10;   lc.setDigit(0,0,seg3,false);    lc.setDigit(0,1,seg4,false);   delay(300); } void setup()    //  ฟังก์ชั่นใช้ในการประกาศค่าเริ่มต้น {   Serial.begin(9600);   //ประกาศการใช้งาน...

arduino 14

รูปภาพ
ใบรายงานผลการปฏิบัติงาน Code #include <LedControl.h>      //  การอ่านไฟล์จากไดเร็กทอรี หรือโฟลเดอร์ที่กำหนดไว้ #include <OneWire.h> #include <DallasTemperature.h> #define ONE_WIRE_BUS 11    //    ใช้เพื่อตั้งชื่อค่าคงที่ OneWire oneWire(ONE_WIRE_BUS);     // ฟังก์ชั่นพิเศษของ  OneWire.h DallasTemperature sensors(&oneWire); float Tfloat;     //   ตัวแปรชนิด floating-point หรือตัวแปรที่มีจุดทศนิยม long Tint;     เป็นตัวแปรจำนวนเต็มแบบขยายโดยไม่มีจุดทศนิยม เก็บค่าแบบ 32 bit   LedControl lc=LedControl(8,10,9,1);  void show6digit(int num)    // การเขียนฟังชังก์ชั่นขึ้นมาโดยใช้ชื่อว่า  show6digit {   int seg1,seg2;   seg2 = (((((num%100000)%10000)%1000)%100)/10);   seg1 = (((((num%100000)%10000)%1000)%100)%10);   lc.setDigit(0,0,seg1,false);    if (num>=10)       lc.setDigit(0,1,seg2,fal...