블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday

Category

2007. 1. 3. 05:09 Hardware

Wiring

void setup() {
  Serial.begin(38400);
}

void loop() {
  if (Serial.real() == 65) {
    Serial.print((analogRead(0)/4));
    Serial.print((analogRead(1)/4));
    Serial.print((analogRead(2)/4));


Processing

import processing.serial.*;
Serial port;
float xpos;

void setup() {
  size(256,256);
  noStroke();
  println(Serial.list());
  port = new Serial(this, Serial.list()[2], 38400);
//  port.clear();
}
void draw(){
 
background(0);
while (port.available() > 0) {
  xpos = port.read();
}
rect(xpos,100,20,20);
}


Wiring

int ax = 0; //set the pin number
int ay = 1;
int az = 2;
int x = 0; //the value of acceleration on x-axis
int y = 0;
int z = 0;

void setup() {
  Serial.begin(38400);
}

void loop() {
  x = analogRead(ax); //read the value of analog pin 0
  y = analogRead(ay);
  z = analogRead(az);
  Serial.print(x/4);
  Serial.print(y/4);
  Serial.print(z/4); //write the scaled value to the serial port
}


 

된장... shielding... orz

'Hardware' 카테고리의 다른 글

[Noah Shibley] eagle PCB  (0) 2008.04.01
smd toast oven  (0) 2008.03.24
soldering  (0) 2006.12.14
testing serial  (0) 2006.12.10
hardware term  (0) 2006.02.21
posted by maetel
2006. 12. 1. 20:51 Hardware/mC
The Wiring I/O board has two built-in (hardware) serial ports called Serial and Serial1. The port Serial is available through the USB connector in the Wiring I/O board. The port Serial1 is available on Wiring I/O pins 2(Rx) and 3(Tx).

ref.
The Wiring Serial library
gone's Wiring workshop: serial

'Hardware > mC' 카테고리의 다른 글

SAM7-H256  (0) 2008.03.17
Arduino board  (0) 2007.11.17
AVR  (0) 2007.07.24
testing Wiring board  (0) 2006.08.16
Wiring board  (0) 2006.08.16
posted by maetel
2006. 8. 16. 16:49 Hardware/mC
To test Wiring board, I did :

1. I/O board installation
2. Trying an example, LED blinks :
// Blinking LED
// by BARRAGAN <http://barraganstudio.com>

int ledPin = 0; // LED connected to the Wiring I/O board pin 0

void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000);
}
3. Uploading a program into I/O board

And the board works!

'Hardware > mC' 카테고리의 다른 글

SAM7-H256  (0) 2008.03.17
Arduino board  (0) 2007.11.17
AVR  (0) 2007.07.24
serial ports on Wiring board  (0) 2006.12.01
Wiring board  (0) 2006.08.16
posted by maetel
2006-05-30 @아트센터나비
아티스트를 위한 컴퓨터 언어의 이해

11. 프로세싱과 와이어링

이재곤



Jim Cambel

SMD (in LED)

James 클라 @NYU

LED를 MicroController와 함께 조명 시스템 구축

AchiGram

2족 보행로봇/RC모형에 들어가는 방향 조절 기능의 서브 모터

MC, felxibility sensor, bluetooth, PIC


+++



sensor -input-> micro-controller -output-> actuator

wiring - 8bit CPU 16
Arduino - wiring에 파생, 간략화한 것
BX-24 - 공대에서 기존에 써 왔던 복잡한 MC

<-input/output-> computer

processing, java, C++, Director, MaxMSP
(serial port를 통해 통신)


* transducer - 에너지의 형태를 전환시켜 주는 장치
eg. sensor, actuator


sensor
빛- CdS, 포토 다이오드, 포토 트랜지스터
소리/진동 - 마이크, 압전 소자(피에조 소자)
온도 - thermistor
가스- 메티놀, 에티놀, 오존
거리 -초음파 거리 센서, 적외선 거리 센서
압력/무게 - 압전 소자, 압력 센서
자기 - 홀 센서, 리드 스위치
위치, 속도, 회전 - 틸트 센서, 가속도 센서, 자이로 센서, 엔코더(볼마우스 안의 바퀴-회전 방향/수 계산, 잉크젯 프린터 안의 잉크와 노즐의 움직임을 통해 위치 측정)), GPS
인체 - 터치 센서 (미세 전류 -> 정전용량 방식)
기타 - RFID (카드 한 장 당 2-3천원, 콘트럴로의 가격도 많이 저렴화), Bluetooth


actuator
빛- 전구, LED, EL(굉장히 얇게 만들 수 있음. 소재가 분말 형식이므로 도포로 쓸 수 있어 flexible한 디스플레이가 가능.
eg. EL wire라는 빛을 내는 실 형태도 있음.)
소리/진동 - 스피커, 압전 소자
온도 - 히터

자기- 코일, 자석
위치/속도/회전- 모터(DC 모터- 속도가 빠르나 컨트롤이 까다로움), 서브 모터(컨트롤이 용이. 정확한 각도 만큼 회전/이동 후 정확히 정지 가능), 스페팅 모터(펄스로 움직여 신호를 한 번 줄 때마다 정확히 해당 정도만 회전하므로 속도도 조정 가능)




i/o board
- digital i/o * 40 - switch/LED
- analog input * 8
- analog output * 6 (PWM으로 표기)
- usb


전압 = 저항 X 전류
0=off=LOW=0V
1=on=HIGH=+5V



디지털 입출력
pinMode(pn,mode)
digitalRead(pn)
digitalWrite(pn, value)

0~39번 핀의 입출력 모드 설정
신호 입력/출력 (HIGH/LOW)


>> 아날로그 입력(10bit)
신호 입력(0~1023)

>> 아날로그 출력(8bit)
신호 출력(0~255)

>> 기타
delay() : 일정시간 실행정지(밀리세컨드 단위로 설정)



> push switch

- 가변저항 사용시 그 저항 범위와 유사한 고정저항을 달아 주면 된다.

- felx sensor - 2-4만원

- 서브 모터 - 펄스의 폭에 따라 회전 정도가 정해짐. 전압을 많이 먹으므로 어댑터가 필요하다.
회로의 동작 속도와 프로그램이 입력하는 신호의 속도 보다 느린 경우가 많으므로 delay등의 명령어를 통해 속도를 맞추어 주어야 한다.


> relay
- 작은 전압(리모컨 or 대기전압)으로 큰 전압(TV 등)을 조정할 때 사용.
- 안에 전자석과 역학적 스위치가 들어 있다.
- MC 회로와 별개의 전원을 쓴다.

> RS232c (usb 포트)
외부 장치와의 통신을 가능하게 함

posted by maetel