2017년 1월 12일 목요일

Setting up your Raspberry PI for Python GPIO Projects



>>

Setting Up Your Raspberry Pi For Python GPIO Projects

The Raspberry Pi is a great tool to get started with electronic tinkering projects. 
It's inexpensive, runs a full-fledged Linux operating system, 
and has I/O pins that can be used to control other electronic devices. 
This quick guide will walk you through the initial setup 
from unboxing your Raspberry Pi, to installing the Python GPIO library.
라즈베리파이는 a 훌륭한 툴이다. to 시작하는데 with 전자 tinkering 프로젝트들을.
저렴하다. 동작하며 a 환벽한-fledged 리눅스 OS, 
and 갖고있다. I/O핀들을 that can be 사용되는 to 제어하는데 다른 전자 장비들을.
이 퀵가이드는 will 예행연습시킬것이다. 널 through the 초기 setup을 통해
from 언박싱하면서부터 네 Raspberry Pi를 to 설치하기위해 the Python GPIO 라이프러리를

This guide assumes that you are using Linux to setup your Raspberry Pi
(hereafter called RPi). 
The RPi itself runs Linux, and the basic skills and commands you learn 
will become very valuable later once you are up and running.
이 가이드는 가정한다. that 네가 사용하고있다고 Linux를 to setup하기위해 네 Raspberry Pi를 
(여기이하 부른다. RPi라고)
그 RPi 그 자체는 돌린다. Linux를, and the 기초 skills & commands... 네가 배우는
...will 될것이다. 매우 가치있게 나중에 once 일단 네가 갖추고 나아간다면.




>>

What You'll Need:


●A Raspberry Pi model A or B


●Micro SD Card with capacity of at least 4GB. Make sure you have an adapter that will allow you to plug it into the USB port on your computer.


An internet connection via ethernet cable, or a micro-usb WiFi adapter such as the Trendnet TEW-648UBM

A working computer with an internet connection. I will be using a computer running Ubuntu Linux for this guide. If you have trouble with these steps, or are using an OS other than Linux, you may find detailed installation instructions in this quick start guide. Return here after you have installed the Raspbian image onto you SD card, and proceed with Step 2.


An HDMI or composite cable to plug the Raspberry Pi into your TV or monitor.

A keyboard and mouse




The first step to setting up you Raspberry Pi 
is to install the Raspbian OS image from the Raspberry Pi website onto your MicroSD card.
첫 단계... to 세팅업하기위한 네 Raspberry Pi를
...는 to 설치하기이다. the Raspbian OS 이미지를 from 웹사이트로부터 onto 네 MicroSD카드상에.
Before starting, 
be sure that your Micro SD card is clean with no existing partitions. 
시작하기전에,
확인해라. that 네 MicroSD 카드가 깨끗한지 with no 남아있는 파티션들 없이.
If you have trouble with these steps, or are using an OS other than Linux, 
you may find detailed installation instructions in this quick start guide. Return here after you have installed the Raspbian image onto you SD card.
만약 네가 갖고있다면 문제를 with 이 단계에서 or 사용중이라면 an OS를 리눅스 이외에.
넌 아마 찾아야한다. 자세한 설치 법을.

Go to the Raspberry Pi Download site and download the latest Raspbian release. 
A the time of this writing, the most recent version is "Wheezy". 
I use the direct download link for sake of simplicity.


When the download is complete, 
open up the terminal and use the cd command to change directories to the folder where you downloaded the distribution, for example:

cd Downloads

Run unzip to extract pi image. Remember, the filename of the distribution may have changed since the time of this writing:

unzip 2012-12-16-wheezy-raspbian.zip

Now change directory to the directory where you unzipped the Raspbian distribution

cd 2012-12-16-wheezy-raspbian

Insert your blank SD card into your computer using a card reader or adapter. 
Run the command df in the terminal to determine the name and location of your SD card.

df -h

From this command, I was able to determine that my usb card was called /dev/sdc1 by looking for the disk that matched the capacity of my SD card

Be aware that some SD cards come pre-formatted with a filesystem. 
This may interfere with the installation of the Raspbian OS image. 
You will want to delete any existing partitions prior to copying the Raspbian image on your SD card. 
To do this, we will use the fdisk utility. 
Run fdisk as a superuser (prefix the command with the word sudo) using the disk name you discovered in the previous step

sudo fdisk /dev/sdc1

You should see a command prompt that looks like this:

Command (m for help):

Type p to see all the partitions on the list. Type d to delete each partition on the card (you may need to do this several times). Once you've deleted all partitions, enter w at the command prompt to save your changes and exit.

Run the df -h command again to list all connected disks. Again, make note of your SD card's name. 
The name may have changed if you deleted any partitions using fdisk. 
For example, my disk name changed to /dev/sdc.

Copy the Raspbian image to your SD card using the dd command as a superuser. 
This action may appear to hang, be patient and wait until you see the command prompt. 
You may need to change the /dev/sdc or the name of the Raspberry Pi image depending on the type of card you are using, and the current Raspberry Pi distribution.

sudo dd bs=4M if=2012-12-16-wheezy-raspbian.img of=/dev/sdc

Run the sync command as superuser

sudo sync

Once the image is written onto the SD card, it's safe to remove the card from your system.




>>

Step 2: First Boot - Configuration Options

Insert the SD card into your Raspberry Pi along with an ethernet cable/WiFi adapter, keyboard, and mouse.
Connect the HDMI or composite cable to your TV/monitor, and turn it on.
Make sure that your TV/monitor is set to the correct input.
Finally plug in the RPi into the AC adapter to power it up.
On the first boot, you will be confronted with a configuration screen. 
You may want to make the following changes, at a minimum:
삽입해라. the SD카드를 into 네 Raspberry Pi에 (나머지를 차례로 연결하고 turn it ON).
확인해라. that 네 TV/monitor가 set되있는지 to the 올바른 입력으로.
마지막으로 플러그인해라. the RPi를 into the AC 어답터에 to 파워업하기위해.
첫 부팅에서, 넌 will be confronted될것이다. with a 구성 화면과 함께.
넌 may 원할지모른다. to make the 따라오는 변화들을, 최소한.

System Password: You may want to chang the administrator password on the RPi. 
By default, it is set to username pi and password raspberry.

Keyboard Language: Change the keyboard setting to your language and locale

Expand the partition: This option will expand the size of your primary partition to the maximum size of your SD card during the next boot. 
Keep in mind that this will take a long time. It takes over 10 minutes to do this on an 8GB card.

Boot to GUI: You may want to have your RPi boot directly into the Graphical User Interface(GUI) rather than to the command line. 
If you leave this option disabled, you can always launch the OS GUI by typing startx on the command line.

If you ever need to re-run the configuration options panel, 
use the following command: sudo raspi-config


>>
Step 3: Optional - Setting Up Your WiFi Adapter
If you are planning to connect to the Internet using an ethernet cable, 
you can skip this section. 
This section will walk you through the process of connecting to your WiFi network 
using a WiFi adapter. 
Please note that you will need to purchase a separate WiFi adapter such as the ... 
The RPi does not have a built-in WiFi adapter.
만약 네가 계획하고있다면 to 연결하기위해 the Internet을 사용하며 an 이더넷 케이블을,
넌 can skip할수있다. 이 섹션을.
이 섹션은 will 예행연습케할것이다. 널 through the 과정을통해 of 연결하는 to 네 WiFi 네트워크에
사용하며 a WiFi 어답터를.
기억해라. that 넌 will need to 구입할필요가있다. a 개별 WiFi 어답터를. such as the...
The RPi는 갖고있지않다. 내장 WiFi 어답터를.

From the GUI, double-click the WiFi Config icon on the desktop

On the Manage Networks tab, click the Scan button.

Double-click the name of the network you wish to connect to. 
You may be prompted to enter security settings for your network.





>>
Step 4: Installing The Python GPIO Library
If you're like me, you bought your RPi to "control things" using the I/O pins on the RPi. 
Using Python and the RPi GPIO library, 
you can do just that. 
Python should already be installed on your RPi, 
and it takes just a minute to install the GPIO library:
만약 네가 나와 같았다면, 넌 샀을것이다. 네 RPi를 to 제어하기위해 뭔가를 사용하여 the I/O 핀들을 on the RPi상의
사용하기 Python을 and the RPi GPIO 라이브러리를
넌 can 할수있다. 이런걸
Python은 should already be 설치되야만한다. on 네 RPi상에
그리고 몇분 걸린다. to 설치하는데 the GPIO 라이브러리를:

Open the terminal on your RPi. Double-click the icon on the desktop named LXTerminal
열어라. 터미널을.

Type the following command to download the GPIO library as a tarball:
타이핑해라. 따라오는 명령어를 to 다운로드하기위해 the GPIO라이브러리를

wget http://raspberry-gpio-python.googlecode.com/files/RPi.GPIO-0.4.1a.tar.gz


Unzip the tarball:
압축해제해라.

tar zxvf RPi.GPIO-0.4.1a.tar.gz


Change to the directory where tarball was inflated:
바꿔라. to the 디렉토리로 where tarball이 부풀어오른곳으로

cd RPi.GPIO-0.4.1a


Install the GPIO library in Python:
설치해라. the GPIO라이브러리를

sudo python setup.py install
Important: You must be a superuser to run scripts that control the GPIO pins on your RPi.
If you are using the IDLE IDE to write your Python scripts,
be sure to launch it as a superuser.
Open the terminal and type sudo idle to launch the IDLE IDE as a superuser,
otherwise any scripts that utilize the GPIO library
will not work.
중요: 네가 반드시 되야한다. a superuser가 to 동작시키기위해 scripts를 that 제어하는 the GPIO핀들을
만약 네가 사용중이면 the IDLE IDE를 to 쓰기위해 네 Python scripts를,
확실히해라. to launch하는걸 it을 as a superuser로써.
열어라. the 터미널을 and type해라. sudo idle이라고 to launch하기위해 the IDLE IDE를 as a superuser로
그렇지않으면 어느 scripts든... that utilize하는 the GPIO 라이브러리를
...will not 동작하지않을것이다.


>>
Time For Your First Project
Now that you have everything setup, you are ready for your first project
Click here to for a very easy tutorial that will teach you how to turn an led on and off using Python.

2017년 1월 4일 수요일

Raspberry PI GPIO Tutorial

.
.
.
import spidev
from time import sleep
import os
#First open up SPI bus
Spi = spidev.SpiDev( )
Spi.open(0,0)
#Initialize what sensor is where
lightChannel = 0
tempChannel = 1
sleepTime = 1

2016년 12월 28일 수요일

PiCam 관련 commands

>>import picamera
Call the PiCam Library
파이카메라 관련 라이브러리를 불러온다.
이제 라이브러기 사용이 가능하다.
>>camera = picamera.PiCamera()
파이카메라 라이브러리 안의 PiCamera()메소드를 이용하여 camera변수에 값을 담는다.
>>camera.capture('image.jpg')
이 명령어를 통해서 사진을 찍고 파일러 저장한다.

2016년 12월 23일 금요일

한우성 애드센스 코드

instruc........ti...... 페이지의 HTML 태그 바로 뒤에 붙여넣으세요.
---------------------------------------------------------





----------------------------------------------------------------------
http://www.yandex.ru/clck/jsredir?from=www.yandex.ru%3Bsearch%eF%3Bweb%3B%3B&text=&etext=1270.2F0PlciagclVa_2HQo3_FVFYNyrx-
KlkKVpqcfUgJTceG-Kk0nUY6WolxfqtF-
FNIbiVrE5cXE2E7QzLM8CVOw.5f3a75e357f1d75cdff1fb924aa0e3d7ed26edff&uuid=&state=PEtFfuTeVD5kpHnK9lio9





http://www.yandex.ru/clck/jsredir?from=www.yandex.ru%3Bsearch%eF%3Bweb%3B%3B&text=&etext=1270.2F0PlciagclVa_2HQo3_FVFYNyrx-KlkKVpqcfUgJTceG-Kk0nUY6WolxfqtF-FNIbiVrE5cXE2E7QzLM8CVOw.5f3a75e357f1d75cdff1fb924aa0e3d7ed26edff&uuid=&state=PEtFfuTeVD5kpHnK9lio9





2016년 1월 16일 토요일

Floppy brushless motor



@#$%



http://www.farrellf.com/projects/hardware/2012-05-20_Brushless_Motors_as_Rotary_Encoders/
Brushless Motors as Rotary Encoders
May 20, 2012
Brushless motors can be used as rotary encoders.
When the rotor is turned the three coils will produce AC waveforms, 
each one-third out of phase with the next coil.
로터가 돌아갈때, 3개 코일들은 will 만들어낸다 AC 웨이브폼을, 
각 1/3 out of phase with the next coil.


The period and amplitude depend on how fast the rotor is turned.
주기 and 진폭은 달려있다 on 얼마나 빨리 the 로터가 돌아갔는지.
Spinning the rotor faster will result in shorter periods and higher amplitudes. 
돌리기 the roter를 더빨리 는 will 결과를 낳을것이다 in 더짧은 주기들을 and 더높은
Feeding those waveforms into op amps does the trick.
먹이기 those 웨이브폼들을 into op 앰프에 does the 트릭을 한다. 
For this test I displayed a number on an LCD and used a buzzer to play a 5KHz tone for each clockwise movement and a 1KHz tone for each counter-clockwise movement.
The motor is from an old floppy disk drive.
이 첫테스트를 위해 난 디스플레이했다. a 넘버를 on an LCD상에
and 난 사용했다 a 버저를 to 플레이하기위해 a 5KHz 톤을 for 각 시계방향 이동을 and a 1KHz 톤을 for 각 반시계방향 이동을 위해. 
The 모터는 from 오래된 플로피디스크. 





The op amps are used to turn each AC waveform into a square wave that can be interrupted by the microcontroller:
오피앰프가 사용된다 to 각 AC웨이브폼을 into a 스퀘어 웨이브로 that can be 인터럽트되는 by the 마이크로컨트롤러에 의해:



If an op amp is used as a simple comparator (waveform going to one input,
with the other input tied to ground)
there will be problems if you spin the rotor slowly or very fast.
The slightest amount of noise will cause glitches.
(The output will swing high or low when it shouldn't.)
만약 an op 앰프가 사용되면 as a 심플 비교기 (웨이브폼 going to 하나의 입력으로가는,
with the other 입력과 묶인 to GND에)
there will be 문제가 될수있다. if you 스핀하면 rotor를 매우느리게 or 매우빠르게.
The 매우작은 량 of 노이즈 will 유발할것이다. glitches를.









A little positive feedback adds hysteresis to the circuit.
This is simply a threshold which must be crossed
in order to get the output to swing high or low.
For my particular motor I needed the threshold to be approximately 70mV.
If the threshold is too low noise can still get through
and cause problems.
If the threshold is too high you will not be able to sense slow rotations.
The sweet spot will be different for every motor.
작은 (+) 피드맥은 더한다. 히스테리시스를 to the 회로에.
이건 간단히 a threshold(=기준점)이다. which must be 지나가야만하는
in order to 얻기위해 the 출력을 to 스윙하기위해 높게 or 낮게.
For 내 특정 모터에선, 난 필요했다. the threshold가 to be 대략 70mV가 되기위해.
If the threshold가 너무 낮다면 noise는 can sill get though(=통과)할수있다.
and cause 문제들을 야기할수있다.
If the threshold 가 너무 높으면, 넌 will not be able to 감지할 수 없다. 느린 회전들을.
그 sweet spot은 will be 다를것이다. for 매 모터마다.





Positive feedback supplies part of the op amp output back into the non-inverting input. A voltage divider is used to provide the feedback,
one end goes to the op amp output
and the other end goes to ground.
양의 피드백은 공급한다. part of the op amp 출력을 back into the 비반전 입력으로.
A 전압 분배기는 사용된다. to 제공하기위해 the 피드백을,
one end는 간다. to the op amp 출력으로
and the other end는 간다. to GND로.


To get 70mV when the output is high I needed two resistors with a 54.3:1 ratio.
To find the x:1 ratio, use: x = (output high voltage) / (desired mV) * 1000.
To minimize current flow the two resistors should add up to more than 1K.
The op amps I used will output about 3.8V
when supplied with 5V
so I used some 27K and 470 resistors that I had laying around
which gave a 66mV threshold.
To 얻기위해 70mV를 when the 출력이 high일때 난 필요했다. 2개 저항들이 with a 54.3:1비율이.
To 찾기위해 the x:1 비율을, 사용해라: x=(출력 고전압) / (원하는 mV) * 1000.
To 최소화시키기위해 전류 흐름을 the 2개 저항들은 should 추가해야한다. up to 1K이상.
The op amps 내가 사용한 will 출력할것이다. about 3.8V에 대해
when 공급됬을때 with 5V
so 난 사용했다. some 27K and 470 저항들을 that 내가 had 나돌아나니게한 주변에
which 준 a 66mV threshold(=기준점)를.



When an op amp input has a voltage below the negative supply voltage,
most op amps will effectively short that input to ground through a diode.
Since the motor is only being spun by hand
this will not be a problem but some current limiting resistors should be in series with all motor leads to be on the safe side.
Also keep the op amp voltage limits in mind
when using larger motors
or if you will be spinning the rotor at a significant speed.
When an op 앰프 입력이 갖고있을때 a 전압 below the 음의 공급 전압 아래의,
대부분의 op 앰프들은 will 효과적으로 short될것이다. that 입력 to GND through a 다이오드를 통한.
Since the 모터는 only being spun돌아가게될것이기때문에 by 손으로
이건 will not be a 문제가되지않을것이다. but some 전류 제한하는 저항들을 should be in 직렬로 with all 모터는 인도한다. to be on the 안전한 쪽으로.
(since 현재형, ~미래형)
Also keep the op 앰프 전압 제한들을 in mind에 담아라.
when 사용하는중일때 더큰 모터들을
or if 네가 will be 돌리고있는중일때 the rotor를 at a 상당한 스피드로.

I initially set up three op amps, one for each coil. This resulted in noticeable glitching at low speeds. The resistors I used for positive feedback have a 5% tolerance, resulting in the threshold for each coil being slightly different. I'm fairly certain that was the cause of the problem but I may be wrong. There is still a little glitching when using just two coils but it occurs far less often.

Here's the final schematic and code:





▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
#include

LiquidCrystal lcd(9,7,6,5,4,3); // RS, Enable, D4, D5, D6, D7
int count = 0;
byte currentA, currentB, previousA, previousB = 0;

void setup() {
  lcd.begin(16, 2);
  previousA = currentA = digitalRead(10);
  previousB = currentB = digitalRead(11);
}

void loop() {
  previousA = currentA;
  previousB = currentB;
  currentA = digitalRead(10);
  currentB = digitalRead(11);

  if(previousA == LOW && previousB == LOW && currentA == HIGH && currentB == LOW) { // clockwise
    count++;
    tone(2, 5000, 2);
  } else if(previousA == HIGH && previousB == HIGH && currentA == LOW && currentB == HIGH) { // clockwise
    count++;
    tone(2, 5000, 2);
  } else if(previousA == LOW && previousB == LOW && currentA == LOW && currentB == HIGH) { // counter-clockwise
    count--;
    tone(2, 1000, 2);
  } else if(previousA == HIGH && previousB == HIGH && currentA == HIGH && currentB == LOW) { // counter-clockwise
    count--;
    tone(2, 1000, 2);
  }

  lcd.setCursor(0, 0);
  lcd.print(count);
  lcd.print("   ");
}
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲






@#$%

2016년 1월 12일 화요일

HC-05 Manual



@#$%



I refered to this blog below
http://phillipecantin.blogspot.ca/search/label/HC-05
전부해석하면 너무 길어서 필요한 부분만 해석했습니다.
댓글 달아주세요


HC-05 BlueTooth link with zero code


필요한것들 ▼
For this, you will need:

  • 1 Arduino (I'm using UNO)
  • 2 HC-05 modules
  • 1 breadboard
  • Wires
  • Arduino IDE (i'm using version 1.0.5-r2)
Step 1 - Code and Wires
To bind the two HC-05s, we will need to input AT commands manually which can be done using this simple code.



    Upload the simple code above
    and carefully connect the wires like below.


    WIRING

    • HC-05 GND --- Arduino GND PIN
    • HC-05 VCC(5V) --- Arduino 5V
    • HC-05 TX --- Arduino Pin 10 (Soft RX)
    • HC-05 RX --- Arduino Pin 11 (Soft TX)
    • HC-05 Key (Pin34) --- Arduino PIN 9


    >>
    Configure the Slave


    2.1 Make sure the power wire (5.0v) is disconnecteded from the HC-05
    2.2 Make sure the Key wire is connected to pin9
    2.3 In the Arduino IDE, goto the Tools\Serial Monitor menu
    2.4 The two following settings are correctly set (at the bottom right of the window):

    2.4.1 Line ending should be set to "Both NL & CR"
    맨 끝라인은 반드시 Both NL & CR 로 마무리지어야한다.

    2.4.2 Baud speed should be set to "9600 baud"

    Note: If you had to modify those settings, I suggest to close and re-open the Serial Monitor dialog


    2.5 When the Arduino is reseted (opening the Serial Monitor dialog will force a reset) you should see the following text "Enter AT commands:" in the Serial Monitor dialog.
    아두이노가 리셋됬을때, 메세지를 볼수있다. "Enter AT commands:"를


    2.7 Connect the power wire(5.0v) on HC-05. You should see the red light slowly blinking (once every ~2 seconds)

    2.8 In the Serial Monitor, type AT and press Enter (or click the Send button).
    The module should return OK right away
    시리얼모니터에서 AT를 타이핑해서 OK가 뜨는지 확인한다.

    2.9 In the Serial Monitor, type AT+ROLE=0 and press Enter.
    This will set the module in Slave mode.
    You can verify that it worked by typing AT+ROLE? (It should return +ROLE:0)
    AT+ROLE=0은 슬레이브모드이다.


    2.10 In the Serial Monitor, type AT+BIND= and press Enter.
    This will remove any existing binding.
    You can verify that it worked by typing AT+BIND? (It should return +BIND:0:0:0)
    바인딩을 제거하고자 할때는 AT+BIND= 를 타이핑하고 Enter를 누른다.

    2.11 In the Serial Monitor, type AT+ADDR? and press Enter.
    This will return the MAC address of this HC-05 module.
    For example: my module's address is 00:13:03:19:14:07
    and the command is returning + ADDR:13:3:191407.
    As you can see the zeros are stripped out and the formatting is a bit different but,
    as you will soon see, this will not be a problem.
    Write down on a piece of paper this MAC address.
    보다시피 the 0들은 잘려나간다. and 포멧팅이 약간 다르다. but 이건 문제가되지않는다.


    2.12 Disconnect the power wire from the HC-05 and remove this HC-05 from the breadboard.
    It is now ready to act as the Slave module.
    Note: Don't disturb the wiring since you will use it to configure the second module.
    와이어를 제거하진 말아라 since 곧 두번째 모듈을 configure할꺼기 때문이다.


    >>
    Configure the Master

    *Start by installing the second HC-05 on the breadboard.
    Exactly where the first module was plugged.
    방금 Slave module연결한 곳에 Master module을 연결한다.

    3.1 Make sure the power wire(5.0)v is disconnected from the HC-05
    3.2 Make sure the Key wire is connected to pin 9
    3.3 In the Arduino IDE, goto the Tools\Serial Monitor menu
    3.4 The two following settings are correctly set (at the buttom right of the window):
    3.4.1 Line ending should be set to "Both NL & CR"
    맨 끝라인은 반드시 Both NL & CR 로 마무리지어야한다.
    3.4.2 Baud speed should be set to "9600 baud"
    Note: If you had to modify those settings,
    I suggest to close and re-open the Serial Monitor dialog

    3.5 When the Arduino is reseted
    (opening the Serial Monitor dialog will force a reset)
    you should see the following text "Enter AT commands." in the Serial Monitor dialog.

    3.7 Connect the power wire(5.0v) on the HC-05.
    You should see the red light slowly blinking (once every ~2 seconds)

    3.8 In the Serial Monitor, type AT and press Enter (or click the Send button).
    The module should return OK right away.

    3.9 In the Serial Monitor, type AT+ROLE=1 and press Enter.
    This will set the module in Master mode.
    You can verify that it worked by typing AT+ROLE? (It should return +ROLE:1)

    3.10 In the Serial Monitor,
    type AT+BIND=13,3,191407 and press Enter (of course here you should be using your MAC address that you have noted on step 2.12).
    This will force the Master module to automatically link (bind) to the Slave.
    You can verify that it worked by typing AT+BIND?
    (It should return +BIND:13:3:191407)
    3.11 Disconnect the power wire from the HC-05 and remove this HC-05 from the breadboard.
    It is now ready to act as the Master module.



    ▼▼▼▼▼
    #include

    SoftwareSerial BTSerial(10, 11); // RX | TX

    void setup()
    {
      pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
      digitalWrite(9, HIGH);
      Serial.begin(9600);
      Serial.println("Enter AT commands:");
      BTSerial.begin(38400);  // HC-05 default speed in AT command more
    }

    void loop()
    {

      // Keep reading from HC-05 and send to Arduino Serial Monitor
      if (BTSerial.available())
        Serial.write(BTSerial.read());

      // Keep reading from Arduino Serial Monitor and send to HC-05
      if (Serial.available())
        BTSerial.write(Serial.read());
    }













    @#$%

    2016년 1월 9일 토요일

    북한, 그리고 한미관계에 대한 개인적인 생각들



    @#$%



    아마 주기적으로 이글을 갱샌하게 될듯하다.
    좀 두서가 없긴하다. 그래도 읽으신 분들은 댓글을 부탁합니다.



    북한의 도발이 일어날때마다 늘 미국의 도움을 빌리는 대한민국을 보며 점점 답답함을 느낀다.
    미국이 과연 진정 우리편인가가 가장 중요하다.
    인천 상륙작전때까지만 해도 미군의 모습은 멋졌다.
    딱 거기까지다.
    최근 미 대선후보중 한면인 도널드 트럼프의 더러운 입만 보더라도
    미국이 한국을 도와 얻는 게 없는데, 보호할 필요가 없다
    한국이 주는 돈은 푼돈에 불과하다.
    ...라는 말을 뱉곤한다.
    여기에 대해 미국의 강력한 부정도 없다시피하다.
    일부 미국인의 생각일지 모르지만, 그렇다고 극소수의 생각이라고 단정짓긴 어렵다고본다.
    이쯤되면 미국이 착한사람으로 돌아오길 신께 기도하기보다는 현실적으로 무기계발에 힘써야한다고 본다.
    강대국들 (미국, 중국, 일본 등등) 의 생각은 한국이 무기계발을 하게되면 북한에서 크게 반발할것이라는 계산을 한다.
    정확히 말하자면 그들은 한국이 무기계발고 강대국의 대열에 들어서는걸 반대하고 있는지도 모르겠다.
    박정희때 한국의 이휘소라는 과학자가 미국에서 의문의 교통사고를 당한일이 있다.
    핵계발의 키를 쥐고있는 몇 안되는 과학자중 하나, 박정희도 핵의 중요성을 알고있는 추진력있는 (뭐 독재였긴하지만) 대통령중 하나였다.
    그렇게 흐지부지되서 지금도 강대국의 틈바구니속의 햄스터만도 못한 존재가 됬다.


    <무기계발의 중요성>
    더군다나 북한의 연평해전, 서해교전, 지뢰도발 들을 당하고도
    기껀 한다는 용기있는 행동이 스피커방송이라니
    그저 웃음밖에 안나온다.
    그럴꺼면 국방비 명목으로 세금을 걷지말고, 홈플러스가서 스피커를 장만하는게 더 똑똑한 소비가 아닐런지.
    예컨데 북한이 미사일 10발을 쏴서 우리가 5발을 맞으면 5발만 북한으로 쏘게끔 되있는 교전수칙 (이런 교전수칙 이름이 뭔지궁금하다. 쓰레기 교전수칙인가) 이 있는데,
    이런 교전수칙은 김대중 정권이후 제1 연평해전 이후 만들어낸 바보같은 수칙이라고한다.
    북한이 참 똑똑한게 살짝살짝 남한을 공격하면서 고위급 접촉으로 합의를 이끌어내는 방법으로 교전수칙을 자기들이 유리한 방법으로 조정하곤한다.
    이런 사실을 남한의 고위급들은 머리가 돌이라서 잘 알지못할것이다.
    이게 아니라면 북한이 남한을 맹공격하지않고 살짝 치고나오는 이유가 사실상 없다.
    이런 경우 늘 합의를 하는데
    합의를 하면 우리가 잃는것은 군 사기이다.
    아래 링크는 2억원을 들여서 만든 지뢰도발로 발목을 읽은 병사를 위해 세운 동상이라고 한다. 보고 판단은 알아서 하시길...
    한번 생각해보자. 상식적으로
    우리 군이 공격을 당했다.
    그들은 복수심에 불타있을것이다. (아니라면 대한민국 사람이 아니겠지)
    헌데 미국등 강대국들은 참으라고 종용한다.
    우리가 고위급접촉을 하자며 빌다시피 북한에 부탁을 한다. (늘 그래왔다.)
    그들은 조건을 붙인다. 우리가 물러날테니 우리 조건을 들어달라.
    우리는 공격할지, 참으며 부탁을 들어줄지 고민도 안하고 그들의 부탁을 들어준다.
    계속 도돌임표이다.
    우리가 잘 하면 그들이 착한 북한으로 돌아올꺼라는건 그저 동화책에만 나오는 계산이다.


    미국에게서 계속 무기를 사들이지만 그들은 핵심기술을 공개하지않고있다.
    그 기술을 공계하면 더이상 무기거래가 끊기는게 문제가 아니고, 한국이 강대국 대열로 들어가는 발판을 마련하는 꼴이된다.
    그들의 입장도 중요하지만 우리가 이해해줄만한 사항을 아니라고 본다.
    그들은 남북 사이에 전쟁급의 문제가 터져도 예전처럼 의로 도와주기보다는 더 비싼 무기거래의 적시로 판단할런지 모른다.
    최근 한국, 그것도 서울에서 탄저균실험을 하다가 들키고 오래발을 내미는 미국을 보면서
    한미간의 신뢰는 깨졌다고 본다.
    별 문제 아니라고 생각하는 이들이 많지만, 이 사건의 밑바닥에는 
    미군이 한국에서 터트리는 모든문제를 조사할때는 한국 단독으로 결정할 수 없고,
    미국과 함께 결정해야한다.
    ...라는 논리적으로 들리지만 다소 거지같은 문구가 명시되어있다.
    이때문에 사소한 폭행문제부터, 탄저균같은 큰 문제까지도 미국이 그냥 넘어가자고 종용하면, 한국은 바보같이 해맑은 미소를 지으며 그들의 손을 붙잡고 화해하는 표정을 카메라앞에서 지어야만한다.
    과연 미국이 친구라고 볼수있을까....?






    김양건의 교통사고 사망설에 많은이들이 의구심을 갖고있다.
    내 생각은 김정은과는 관련이 없다.
    다만 김양건의 반대편에 서있는 사람에의해 제거되지않았을까이다.
    새로운 무기계발이 진전되면 자기들의 힘이 커지는데 김양건이 반대파에 서있어서
    그래서 제거하려하지만 만만치 않아서 아랫사람을 시켜서 조용히 제거하고,
    증거가 없으니 교통사고로 위장해서 김정은에게 보고하지않았을까 하는 생각이다.



    연평해전에 쓰인 고속정......고철행......제대로 미친듯








    @#$%