# create $ ln -s [source] [link-name] # update $ ln -sfn [new source][link-name]
Pin Category | Pin Name | Details |
Power | Vin, 3.3V, 5V, GND | Vin: Input voltage to Arduino when using an external power source.
5V: Regulated power supply used to power microcontroller and other components on the board. 3.3V: 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA. GND: ground pins. |
Reset | Reset | Resets the microcontroller. |
Analog Pins | A0 – A5 | Used to provide analog input in the range of 0-5V |
Input/Output Pins | Digital Pins 0 – 13 | Can be used as input or output pins. |
Serial | 0(Rx), 1(Tx) | Used to receive and transmit TTL serial data. |
External Interrupts | 2, 3 | To trigger an interrupt. |
PWM | 3, 5, 6, 9, 11 | Provides 8-bit PWM output. |
SPI | 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK) | Used for SPI communication. |
Inbuilt LED | 13 | To turn on the inbuilt LED. |
TWI | A4 (SDA), A5 (SCA) | Used for TWI communication. |
AREF | AREF | To provide reference voltage for input voltage. |
Microcontroller | ATmega328P – 8 bit AVR family microcontroller |
Operating Voltage | 5V |
Recommended Input Voltage | 7-12V |
Input Voltage Limits | 6-20V |
Analog Input Pins | 6 (A0 – A5) |
Digital I/O Pins | 14 (Out of which 6 provide PWM output) |
DC Current on I/O Pins | 40 mA |
DC Current on 3.3V Pin | 50 mA |
Flash Memory | 32 KB (0.5 KB is used for Bootloader) |
SRAM | 2 KB |
EEPROM | 1 KB |
Frequency (Clock Speed) | 16 MHz |
Name | Processor | Operating/Input Voltage | CPU speed | Analog In/Out | Digital IO/PWM | EEPROM / SRAM[kB] | Flash | USB | USART |
Uno | ATmega328P | 5V / 7-12V | 16 MHz | 6 / 0 | 14 / 6 | 1 / 2 | 32 | Regular | 1 |
Nano | ATmega328P | 5V / 7-12V | 16 MHz | 8 / 0 | 14 / 6 | 1 / 2 | 32 | Mini |
1 |
Name | Processor | Operating/Input Voltage | CPU speed | Analog In/Out | Digital IO/PWM | EEPROM / SRAM[kB] | Flash | USB | USART |
Mega | ATmega2560 | 5V / 7-12V | 16 MHz | 16 / 0 | 54 / 15 | 4 / 8 | 256 | Regular | 4 |
Nano | ATmega328P | 5V / 7-12V | 16 MHz | 8 / 0 | 14 / 6 | 1 / 2 | 32 | Mini | 1 |
Pin Category | Pin Name | Details |
Power | Vin, 3.3V, 5V, GND | Vin: Input voltage to Arduino when using an external power source (6-12V).
5V: Regulated power supply used to power microcontroller and other components on the board. 3.3V: 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA. GND: Ground pins. |
Reset | Reset | Resets the microcontroller. |
Analog Pins | A0 – A7 | Used to measure analog voltage in the range of 0-5V |
Input/Output Pins | Digital Pins D0 – D13 | Can be used as input or output pins. 0V (low) and 5V (high) |
Serial | Rx, Tx | Used to receive and transmit TTL serial data. |
External Interrupts | 2, 3 | To trigger an interrupt. |
PWM | 3, 5, 6, 9, 11 | Provides 8-bit PWM output. |
SPI | 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK) | Used for SPI communication. |
Inbuilt LED | 13 | To turn on the inbuilt LED. |
IIC | A4 (SDA), A5 (SCA) | Used for TWI communication. |
AREF | AREF | To provide reference voltage for input voltage. |
Microcontroller | ATmega328P – 8 bit AVR family microcontroller |
Operating Voltage | 5V |
Recommended Input Voltage for Vin pin | 7-12V |
Analog Input Pins | 6 (A0 – A5) |
Digital I/O Pins | 14 (Out of which 6 provide PWM output) |
DC Current on I/O Pins | 40 mA |
DC Current on 3.3V Pin | 50 mA |
Flash Memory | 32 KB (2 KB is used for Bootloader) |
SRAM | 2 KB |
EEPROM | 1 KB |
Frequency (Clock Speed) | 16 MHz |
Communication | IIC, SPI, USART |
Name | Processor | Operating/Input Voltage | CPU speed | Analog In/Out | Digital IO/PWM | EEPROM / SRAM[kB] | Flash | USB | USART |
Uno | ATmega328P | 5V / 7-12V | 16 MHz | 6 / 0 | 14 / 6 | 1 / 2 | 32 | Regular | 1 |
Nano | ATmega328P | 5V / 7-12V | 16 MHz | 8 / 0 | 14 / 6 | 1 / 2 | 32 | Mini |
1 |
Name | Processor | Operating/Input Voltage | CPU speed | Analog In/Out | Digital IO/PWM | EEPROM / SRAM[kB] | Flash | USB | USART |
Mega | ATmega2560 | 5V / 7-12V | 16 MHz | 16 / 0 | 54 / 15 | 4 / 8 | 256 | Regular | 4 |
Nano | ATmega328P | 5V / 7-12V | 16 MHz | 8 / 0 | 14 / 6 | 1 / 2 | 32 | Mini | 1 |
หลายภาษามีเครื่องมือแบบนี้เช่น python ถึงคิวจาวา มาใน java 9
REPL สะดวกดีประหยัดเวลาในการจะลองเขียนโค้ดทดสอบสั้นๆ หรือเป็น Console เมื่อต้องการสอนเขียนโปรแกรมก็ได้
pairoch@microbrainLAB:/opt$ jshell -v | Welcome to JShell -- Version 11.0.9.1 | For an introduction type: /help intro jshell> int i =0; i ==> 0 | created variable i : int jshell> /list 1 : int i =0; jshell> int b =10; b ==> 10 | created variable b : int jshell> /list 1 : int i =0; 2 : int b =10; jshell> System.out.orintln("Hello"); | Error: | cannot find symbol | symbol: method orintln(java.lang.String) | System.out.orintln("Hello"); | ^----------------^ jshell> System.out.println("Hello"); Hello jshell> System.out.println("REsult: "+ i+b ); REsult: 010 jshell> System.out.println("REsult: "+ (i+b) ); REsult: 10 jshell> int result = i+b; result ==> 10 | created variable result : int jshell> System.out.println("REsult: "+ result ); REsult: 10 jshell> /list 1 : int i =0; 2 : int b =10; 3 : System.out.println("Hello"); 4 : System.out.println("REsult: "+ i+b ); 5 : System.out.println("REsult: "+ (i+b) ); 6 : int result = i+b; 7 : System.out.println("REsult: "+ result ); jshell> void helloJShell(int i){ ...> for (int x =0; x<i; x++) System.out.println("HEllo "+x); ...> } | created method helloJShell(int) jshell> /list 1 : int i =0; 2 : int b =10; 3 : System.out.println("Hello"); 4 : System.out.println("REsult: "+ i+b ); 5 : System.out.println("REsult: "+ (i+b) ); 6 : int result = i+b; 7 : System.out.println("REsult: "+ result ); 8 : void helloJShell(int i){ for (int x =0; x<i; x++) System.out.println("HEllo "+x); } jshell> helloJShell(3) HEllo 0 HEllo 1 HEllo 2 jshell> helloJShell(4); HEllo 0 HEllo 1 HEllo 2 HEllo 3 jshell> /list 1 : int i =0; 2 : int b =10; 3 : System.out.println("Hello"); 4 : System.out.println("REsult: "+ i+b ); 5 : System.out.println("REsult: "+ (i+b) ); 6 : int result = i+b; 7 : System.out.println("REsult: "+ result ); 8 : void helloJShell(int i){ for (int x =0; x<i; x++) System.out.println("HEllo "+x); } 9 : helloJShell(3) 10 : helloJShell(4); jshell> helloJShell(result) HEllo 0 HEllo 1 HEllo 2 HEllo 3 HEllo 4 HEllo 5 HEllo 6 HEllo 7 HEllo 8 HEllo 9 jshell> helloJShell(12) HEllo 0 HEllo 1 HEllo 2 HEllo 3 HEllo 4 HEllo 5 HEllo 6 HEllo 7 HEllo 8 HEllo 9 HEllo 10 HEllo 11 jshell> if (result < 10)System.out.println("result less than 10"); jshell> /list 1 : int i =0; 2 : int b =10; 3 : System.out.println("Hello"); 4 : System.out.println("REsult: "+ i+b ); 5 : System.out.println("REsult: "+ (i+b) ); 6 : int result = i+b; 7 : System.out.println("REsult: "+ result ); 8 : void helloJShell(int i){ for (int x =0; x<i; x++) System.out.println("HEllo "+x); } 9 : helloJShell(3) 10 : helloJShell(4); 11 : helloJShell(result) 12 : helloJShell(43) 13 : if (result < 10)System.out.println("result less than 10"); jshell> if (result == 10)System.out.println("ryes"); ryes jshell> helloJShell(5) HEllo 0 HEllo 1 HEllo 2 HEllo 3 HEllo 4 jshell> /import | import java.io.* | import java.math.* | import java.net.* | import java.nio.file.* | import java.util.* | import java.util.concurrent.* | import java.util.function.* | import java.util.prefs.* | import java.util.regex.* | import java.util.stream.* jshell> /exit | Goodbye pairoch@microbrainLAB:/opt$
mosquitto_pub -h localhost -t test_topic\topic1 -m "OFF" mosquitto_sub -h localhost -t test_topic\topic1 ## Have Secure $ sudo mosquitto_passwd -c /etc/mosquitto/passwd [MQTT USER] $ sudo systemctl restart mosquitto ## edit config $sudo vi /etc/mosquitto/conf.d/default.conf allow_anonymous false password_file /etc/mosquitto/passwd ##example mosquitto_sub -h localhost -t test -u [MQTT USER] -P [MQTT PASS] mosquitto_pub -h [MQTT SERVER]-t test -m "hello world" -u [MQTT USER] -P [MQTT PASS]