336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


Naver

[cylinder subtract]



▼Space >> Add Cylinder

원통(=Cylinder)를 만든다.


▼Ctrl+C   Ctrl+V를 하여 같은 위치에 붙여넣기를한다.

Z 클릭하여 X-Ray모드로 들어간다.

S to Scale Down을 하여 내부로 들어가는 원동을 만든다.


▼각각의 원통을 Add Modifier를 통해 Boolean모드를 적용시킨다.

공구아이콘 >> Add Modifier >> Boolean



▼여기부터가 중요하다.

Cylinder를 위로 살짝 이동시켜서

Cylinder 사이의 두께를 만든다.


▼Extract를 하기위해서

두 객체의 Operation을 모두 Difference로 체크한다.


▼Outter Cylinder를 선택후 Object를 Inner Cylinder를 지목한다. 


▼Inner Cylnder를 Grab out 하면 결과를 확인할 수 있다.


▼이제 Cylinder의 옆면을 깍아보자


▼먼저 해야할 일은 Cube를 이용하여 Subtract하는 일이다.

두개를 겹치고 

공구아이콘>>Add Modifier>>Boolean 으로 들어가서

두 객체 모두 Difference로 체크한다.


▼Cube객체를 Grab으로 이동시키면 잘려진 부분을 확인할 수 있다.

여기에 Cube를 평면으로 만들어서 덧대면 아래 Top Down View를 확인할 수 있다.

▼Top Down View

▼결과물




Cube4 >> Cube3  (Clicking order)

Bolean 선택후 Difference로 Cube4를 지정해줘야

Cube4가 사라지며 구멍이 생긴다.


응요하면 아래와 같은 V형태고 구현 가능하다.


Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://wormfood.net/avrbaudcalc.php

흔히 쓰는

16MHz에 9600bps 라면

UBRR은 103이 된다.

===========================================================

//http://mulgu.kr/entry/Code-Example-ATMEGA848-UART-%EC%98%88%EC%A0%9C%EC%86%8C%EC%8A%A4


▼ATmega8기준 (수정 필요하면 instructables.tistory.com/64 로 의뢰해주세요)


#define F_CPU 16000000UL  // ◀8000000UL == 8 MHz


/* Very Important - change F_CPU to match target clock 

  타겟 클락에 맞춰서 바꿀것

Note: default AVR CLKSEL is 1MHz internal RC

디폴트는 1MHz 내부 RC이다.

  This program transmits continously on USART.

Interrupt is used for 

Receive charactor, which is then transmitted instead.

LEDs are used

as a test. Normal RX routine is included but not used.

  Change USART_BAUDRATE constant to change Baud Rate

*/


#include <avr/io.h>

#include <util/delay.h>

#include <avr/interrupt.h>


// Define baud rate

#define USART_BAUDRATE 9600//◀38400   

#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)

// 8000000 / (38400 * 16)

// 8000000 / 614400 = 625/48

// 625/48 - 1 = 577/48 = 12.0208...


volatile unsigned char value;  

/* This variable is volatile so both main and RX interrupt can use it.

It could also be a uint8_t type */


/* Interrupt Service Routine for Receive Complete 

NOTE: vector name changes with different AVRs see AVRStudio -

Help - AVR-Libc reference - Library Reference - <avr/interrupt.h>: Interrupts

for vector names other than USART_RXC_vect for ATmega32 */


ISR(USART_RXC_vect)

   value = UDR;             //read UART register into value

   PORTB = ~value;          // output inverted value on LEDs (0=on)

}


void USART_Init(void)

{

   // Set baud rate

   UBRRL = BAUD_PRESCALE;// Load lower 8-bits into the low byte of the UBRR register

   UBRRH = (BAUD_PRESCALE >> 8); 

/* Load upper 8-bits into the high byte of the UBRR register

    Default frame format is 8 data bits, no parity, 1 stop bit

  to change use UCSRC, see AVR datasheet*/ 


  // Enable receiver and transmitter and receive complete interrupt 

  UCSRB = ((1<<TXEN)|(1<<RXEN) | (1<<RXCIE));

}



void USART_SendByte(uint8_t u8Data)

{

// Wait until last byte has been transmitted

  while((UCSRA &(1<<UDRE)) == 0);

  // Transmit data

  UDR = u8Data;

}



// not being used but here for completeness

// Wait until a byte has been received and return received data 

uint8_t USART_ReceiveByte()

{

while((UCSRA &(1<<RXC)) == 0);

  return UDR;

}


void Led_init(void)

{

//outputs, all off

DDRB =0xFF;       

PORTB = 0xFF;        

}


int main(void)

{

    USART_Init();  // Initialise USART

    sei();         // enable all interrupts

    Led_init();    // init LEDs for testing

    value = 'A'; //0x41;    

    PORTB = ~value; // 0 = LED on

   

    for(;;){    // Repeat indefinitely

             

     USART_SendByte(value);  // send value 

     _delay_ms(250);         

        // delay just to stop Hyperterminal screen cluttering up    

   }

}



Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


Naver

[photo interrupt...]

[sg-23ff]



질문은 아래 남겨주세요

의뢰는 링크 를 눌러주세요

SG-23FF      SG-23FF 데이터시트.txt


질문 있는 분들은 댓글 남겨주세요

▼구매처 링크들

http://www.ds-parts.co.kr/goods_detail.php?goodsIdx=5735


▲Pull-Down 저항은 10K는 써줘야 출력이 확실히 나간다. (최소 1K이상은 써야함)




SG-23FF




위아래 그림 둘다 같은 내용이다.






SG-23FF 데이터시트.txt


Input에서

P(소모전력)= VI

100mW = V*60mA

V = 100mW / 60mA = 1.6V (이 값을 넘어서면 전류 또한 높아지므로 역전류 발생)

5V공급일때 LED에 1.6V가 흘러가야한다.

Power Dissipation을 보면 100mW = 0.1W (1/8W 저항이 0.125W에 해당하므로 여기에 가깝다.) (몇 Watt 저항을 택해야할지 고민일때 이걸 참고하면 된다.)

Power Dissipation = 100mW 이므로

1/8W = 0.125W의 저항을 사용해야한다.

1/8W이상의 두꺼운 저항을 사용하면 LED쪽으로 역전류가 발생해서 LED가 망가지게 된다.

Reverse Voltage가 5V까지이므로 저항 사용에 유의하자.





Output

P=VI

100mW = V*40mA

V = 100mW / 40mA = 2.5V




V=IR    (C-E가 30V까지 견딘다.)

R=V/I = 30V/40mA = 750Ω

Collector Power Dissipation은 100mW = 0.1W (1/8W 저항이 0.125W에 해당하므로 여기에 가깝다.)

P=VI V=IR

P=I^2 * R

0.1 = I^2 * 750

I^2 = 7500

I = 86.60254

만약 저항을 200Ω을 썼다면...

P=I^2 * R

0.1 = I^2 *200

I^2 = 2000

I = 44.721 A



http://www.electroschematics.com/10494/arduino-optical-position-rotary-encoder/

▲아두이노 + 포토 인터럽트 테스트 회로 & 코드

(인코더를 구성할때 어떻게 해야하는지 알려준다.)





Arduino Interrrupt

부품리스트

Arduino UNO : 7500

Photo Interrupter : 500

http://www.ds-parts.co.kr/goods_detail.php?goodsIdx=5735

Fan Motor : 5000

USB Cable : 500

5V 1A adapter : 8000

http://www.ds-parts.co.kr/goods_detail.php?goodsIdx=12310

=21500 ≒ 21000원



proteus.rar

Test_program.ino.hex

기능설명

Default 출입인원은 0명이다.

이때 온도센서값에 따라 Fan의 동작유무가 결정된다.

UP버튼이 눌리면 출입인원이 CountUp 된다.

미리 설정된 인원을 초과하게되면 온도센서는 Disabled상태가 되며 스위치에 의해 Fan의 동작유무가 결정된다.

DOWN버튼을 눌러 초과인원을 줄이게되면 다시 온도센서를 통한 Fan 동작이 가능하게된다.

이때는 스위치가 Disabled상태가 된다.

(왼쪽의 가변저항=온도센서, 상단의 LED=Fan)

Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백