Wednesday, August 30, 2017

mac use ssh to clone harddisk from remote server to local usb harddisk

  1. plug the harddisk to mac
  2. use Terminal
  3. use "diskutil list" to find the new harddisk
  4. use "diskutil unmount /dev/diskX "
  5. mac "ssh -l user yourserver.com" to set sudo dd without password (omitted)
  6. mac "sudo" to enter password for dd
  7. ssh -l user yourserver.com "sudo /bin/dd if=/dev/sda" | dd of=/dev/disk2 
  8. Rest and wait



To monitor dd progress, Command + T to open new terminal tab
 
-While dd is executing, run this in another terminal:
while pgrep ^dd; do sudo pkill -INFO dd; sleep 1; done
 
It prints the dd status every 1 second in the original terminal window where dd is executing, and quits when the command is done. 

Thursday, July 6, 2017

Arduino Software Downloads

Main Software:

  1. Arduino IDE  

  2. CH340 for Windows 


 

CH340for Other OS (Windows, MAC, Linux), https://sparks.gogo.co.nz/ch340.html

 

Other Software 其他開發環境:

mBlock

S4A

S4A Firmware

Python

 

 

WeMos D1

Monday, July 3, 2017

Thermometer using TO-92 with Light Indicator



 

//This program sense temperature using TO-92 to A0 analog input, with lighting indicator to digital pin 2,3,4, and output voltage level through serial output at 9600bps

//20C -> OFF, OFF OFF

//22C-> ON, OFF OFF

//24C-> ON, ON OFF

//26C-> ON ON ON

 

const int sensorPin = A0;
const float baselineTemp = 20.0;

void setup(){
Serial.begin(9600);

for(int pinNumber = 2; pinNumber<5; pinNumber++){
pinMode(pinNumber,OUTPUT);
digitalWrite(pinNumber, LOW);
}
}

void loop(){
int sensorVal = analogRead(sensorPin);
Serial.print("Sensor Value: ");
Serial.print(sensorVal);

float voltage = (sensorVal/1024.0) * 5.0;
Serial.print(", Volts: ");
Serial.print(voltage);
Serial.print(", degrees C: ");
float temperature = (voltage -0.5) * 100;
Serial.println(temperature);

if (temperature < baselineTemp){
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
}else if (temperature >= baselineTemp+2 &&
temperature < baselineTemp+4){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}else if (temperature >= baselineTemp+4 &&
temperature < baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}else if (temperature >= baselineTemp+6){
digitalWrite(1, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
}
delay(1);
}

Resistor Color Code

https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-resistor-color-code-4-band

 

Friday, June 23, 2017

Arduino Starter Kit

Official Site:

https://store.arduino.cc/usa/arduino-starter-kit

 

Projects you can make:

  • 01 GET TO KNOW YOUR TOOLS an introduction to the basics

  • 02 SPACESHIP INTERFACE design the control panel for your starship

  • 03 LOVE-O-METER measure how hot-blooded you are

  • 04 COLOR MIXING LAMP produce any color with a lamp that uses light as an input

  • 05 MOOD CUE clue people in to how you're doing

  • 06 LIGHT THEREMIN create a musical instrument you play by waving your hands

  • 07 KEYBOARD INSTRUMENT play music and make some noise with this keyboard

  • 08 DIGITAL HOURGLASS a light-up hourglass that can stop you from working too much

  • 09 MOTORIZED PINWHEEL a colored wheel that will make your head spin

  • 10 ZOETROPE create a mechanical animation you can play forward or reverse

  • 11 CRYSTAL BALL a mystical tour to answer all your tough questions

  • 12 KNOCK LOCK tap out the secret code to open the door

  • 13 TOUCHY-FEEL LAMP a lamp that responds to your touch

  • 14 TWEAK THE ARDUINO LOGO control your personal computer from your Arduino

  • 15 HACKING BUTTONS create a master control for all your devices!


 

 

Video Tutorial

 

 

Specification

1 Projects Book (170 pages),

Arduino / Genuino Uno,

USB cable,

Breadboard 400 points,

70Solid core jumper wires,

Easy-to-assemble wooden base,

9v battery snap,

1 Stranded jumper wires (black),

1 Stranded jumper wires (red),

Phototransistor,

Potentiometer 10kOhms,

10Pushbuttons,

Temperature sensor [TMP36],

Tilt sensor,

alphanumeric LCD (16x2 characters),

1LED (bright white),

LED (RGB),

LEDs (red),

LEDs (green),

LEDs (yellow),

LEDs (blue),

Small DC motor 6/9V,

1 Small servo motor,

Piezo capsule [PKM17EPP-4001-B0],

H-bridge motor driver [L293D],

Optocouplers [4N35],

Mosfet transistors [IRF520],

Capacitors 100uF,

Diodes [1N4007],

Transparent gels (red, green, blue),

Male pins strip (40x1),

20 Resistors 220 Ohms,

5Resistors 560 Ohms,

Resistors 1 kOhms,

Resistors 4.7 kOhms,

20 Resistors 10 kOhms,

5Resistors 1 MOhms,

Resistors 10 MOhms