embeded/arduino(genuino)2017. 12. 28. 23:03

심심해서 짜본

바운서 개조용(?) 아두이노 나노 코드

서보는 D9 핀에 연결하도록 했고

시간은 ms 단위로 최소각도와 최대각도 사이를

편도시간으로 설정하여 반복하도록 작성했음


#include <Servo.h>
Servo servo;
int servoPin = 9;

long swing_period = 3000;
long servo_period = 10;
long swing_count  = 0;
long dir = 0;
long angle = 0;
long min_angle = 45;
long max_angle = 135;
long move_angle = max_angle - min_angle;

void setup() {
  // put your setup code here, to run once:
  servo.attach(servoPin);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (swing_count < swing_period) swing_count += servo_period;
  else
  {
    swing_count = 0;
    if (dir == 0) dir = 1;
    else dir = 0;
  }

  if (dir == 0) // inc
    angle = min_angle + move_angle * swing_count / swing_period;
  else // dec
    angle = max_angle - move_angle * swing_count / swing_period;

  servo.write(angle);
  delay(servo_period);
}



정작 달아 보니

아내 왈 : 왜케 조금 움직여? 걍 떼

... 아놔.. ㅠㅠ



+

2017.12.29

개발자 아빠들이란 ㅋㅋㅋ

일단 우리집에 있는건 저렇게 전체가 흔들리는 버전이 아니라 저걸 적용하기는 무리 ㅋㅋ


[링크 : https://www.youtube.com/watch?v=lr7Dg2AO97c]

[링크 : https://www.youtube.com/watch?v=EmSneb8MVgg]

'embeded > arduino(genuino)' 카테고리의 다른 글

아두이노 미세먼지 센서  (2) 2018.03.30
USB to TTL 정보  (0) 2018.01.10
간만에 지름신  (0) 2017.10.26
릴레이로 AC전원 스위치하기  (0) 2017.10.26
hoverlabs 사의 hover 제품  (0) 2017.07.17
Posted by 구차니
embeded/arduino(genuino)2017. 10. 26. 14:30

홈페이지 만드는거 따윈 포기하고

역시 땜질이 최고지(?) ㅋㅋ


블루투스 이어폰 잘라놓은거 한번 만들어 보고

릴레이로 무언가 좀 장난질 좀 쳐봐야지(아.. 남는 멀티탭이 있으려나? ㅠㅠ)



Posted by 구차니
embeded/arduino(genuino)2017. 10. 26. 13:48

예전에는 그냥 GPIO로 제어만 해서

실제로 AC나 DC를 물리지 않았던 지라..

한번 선풍기/전기장판 이런거 제어해볼가 하고 일단 구매하려고 하는데..


AC는 두개를 모두 릴레이로 따로 제어해주어야 하나?

하나의 선만 하면되려나? 헷갈리네?


[링크 : http://deneb21.tistory.com/222]

[링크 : http://bbangpan.tistory.com/79]

[링크 : http://blog.naver.com/yunks4001/220029836358]


[링크 : http://rabbitmax.com/files/SONGLE-SRD-05VDC-SL-C.pdf]


일단은.. 그냥 NC-COM 연결하면 되는거 같긴한데..

[링크 : http://howtomechatronics.com/tutorials/arduino/control-high-voltage-devices-arduino-relay-tutorial/]


NO에 연결하면 LOW 일때 스위치가 연결되는 듯?

그럼.. NC에 하면 LOW 일때 스위치가 끊어지려나?

digitalWrite(RELAY1,LOW); // Turns ON Relays 1

Serial.println("Light ON");

delay(2000); // Wait 2 seconds

digitalWrite(RELAY1,HIGH); // Turns Relay Off

Serial.println("Light OFF");

delay(2000); 

[링크 : http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/]


A접점(arbeit contact)은 전기적으로 릴레이에 전류가 흐르면 동작하여 닫히는(ON) 접점

(normally open contact). 

 

B접점(break contact)은 전기전으로 릴레이에 전류가 흐르면 동작하여 접점이 열리는(OFF) 접점.

상시폐접점(normally closed contact).


C접점(change-over contact)은 a, b접점부를 공유, 트랜스퍼 접점(transfer contact) 이라고도 함.


A접점=NO(Normally open)

B접점=NC(Normally closed)

C접점=Transfer contact

[링크 : http://blog.naver.com/hjhmsshs/50190270118]



+

2020.03.07

전원선 끊어서 NO(normal open, 전원 차단시 꺼짐) - COMMON에 연결하면 된다.

[링크 : http://makeshare.org/bbs/board.php?bo_table=arduinoetc&wr_id=14]

[링크 : https://studyingandsuccess.tistory.com/18]

Posted by 구차니
embeded/arduino(genuino)2017. 7. 17. 17:12

신기한 제품을 중고나라에서 팔고 있길래 찾아봄


[링크 : http://www.hoverlabs.co/products/hover/]

[링크 : http://chipkit.net/tag/hover-labs/]


The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller.

[링크 : http://www.microchip.com/wwwproducts/en/MGC3130]



간단하게 저 칩이 핵심이고

전기장을 이용해서 터치뿐만 아니라 0~20cm 이내의 x,y,z 축에 대한 포인팅을 집어내고

그걸 기반으로 제스쳐 데이터를 빼내는 듯(아래로,위로,좌,우 이런식 + 앞,뒤)

'embeded > arduino(genuino)' 카테고리의 다른 글

간만에 지름신  (0) 2017.10.26
릴레이로 AC전원 스위치하기  (0) 2017.10.26
아두이노 스켈레톤 코드 및 부트로더  (0) 2017.02.11
avrdude arduino  (0) 2016.12.02
pwm ppm decode  (0) 2016.11.28
Posted by 구차니
embeded/arduino(genuino)2017. 2. 11. 12:54

그렇게 궁금해 하던 오리지널 소스 발견!


int main(void)
{
init();
initVariant();
#if defined(USBCON)
USBDevice.attach();
#endif
setup();
for (;;) {
loop();

if (serialEventRun) serialEventRun();

}
return 0;
}



[링크 : https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/main.cpp]

    [링크 : https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/cores/arduino]


[링크 : https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/bootloaders] AVR기반

[링크 : https://github.com/arduino/ArduinoCore-samd/tree/master/bootloaders/zero] ARM기반


2016/03/28 - [embeded/arduino(genuino)] - 아두이노 빌드 프로세스 & c/cpp



+

간단하게 말해서.. FT232 USB to RS232 칩에서 DTR를 감지하면 자동으로 리셋을 걸어버린다.

그런 이유로 아두이노 부트로더에만 업로드 하는 것이 있고,

아두이노 sketch쪽 스켈레톤 코드에는 특정 코드에서 리부팅 하는 부분이 없다.


Since the DTR signal goes from 5V to 0 at the moment a new connection to the Arduino is started, if you send this signal to the reset line of the Arduino's processor, it resets. 

[링크 : http://www.instructables.com/id/Overview-the-Arduino-sketch-uploading-process-and-/]


Data Terminal Ready (DTR) is a control signal in RS-232 serial communications, transmitted from data terminal equipment (DTE), such as a computer, to data communications equipment (DCE), for example a modem, to indicate that the terminal is ready for communications and the modem may initiate a communications channel.

[링크 : https://en.wikipedia.org/wiki/Data_Terminal_Ready]

[링크 : https://www.arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf]


대충보면.. Makefile에서 sketch를 c로 변경해서 빌드할때 .text 섹션을 BOOT_START 주소로 옮기고 링킹하는 듯?


$ vi /usr/share/arduino/hardware/arduino/bootloaders/caterina/Makefile

#---------------- Linker Options ---------------- # -Wl,...: tell GCC to pass this to linker. # -Map: create map file # --cref: add cross reference to map file LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--gc-sections LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) #LDFLAGS += -T linker_script.x








-Wl,--section-start=.bootloader=0x1E000 

[링크 : http://www.atmel.com/webdoc/AVRLibcReferenceManual/FAQ_1faq_reloc_code.html]

'embeded > arduino(genuino)' 카테고리의 다른 글

릴레이로 AC전원 스위치하기  (0) 2017.10.26
hoverlabs 사의 hover 제품  (0) 2017.07.17
avrdude arduino  (0) 2016.12.02
pwm ppm decode  (0) 2016.11.28
arduino clcd  (0) 2016.11.25
Posted by 구차니
embeded/arduino(genuino)2016. 12. 2. 21:46

아두이노에서 아두이노 부트로더를 통해 시리얼로 업로드 하는데

avrdude를 통해 사용할떄는 프로그래머 타입을 arduino로 설정을 한다.

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2009 Joerg Wunsch


         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"


         Using Port                    : COM6

         Using Programmer              : arduino

         Overriding Baud Rate          : 57600

         AVR Part                      : ATmega328P 

2016/03/27 - [embeded/arduino(genuino)] - 아두이노 나노 - 시리얼 테스트


Binary sketch size: 1,084 bytes (of a 30,720 byte maximum)

D:/arduino-1.0.4/hardware/tools/avr/bin/avrdude -CD:/arduino-1.0.4/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P.COM22 -b57600 -D -Uflash:w:C:/Users/aSensar/AppData/Local/Tempbuild1227546797508918322.tmpBlink.cpp.hex:i 

[링크 : http://asensar.com/article/program-arduino-with-avrdude.html]


라즈베리의 GPIO를 통해서 spi 통신을 하는건지 

라즈베리의 spi로 avrisp를 흉내내는건진 잘 모르겠다.

[링크 : https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins/installation]


[링크 : https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader]

[링크 : http://svn.savannah.nongnu.org/viewvc/trunk/avrdude/arduino.c?revision=1321...p]

'embeded > arduino(genuino)' 카테고리의 다른 글

hoverlabs 사의 hover 제품  (0) 2017.07.17
아두이노 스켈레톤 코드 및 부트로더  (0) 2017.02.11
pwm ppm decode  (0) 2016.11.28
arduino clcd  (0) 2016.11.25
arduino nano 스펙(PWM)  (0) 2016.11.25
Posted by 구차니
embeded/arduino(genuino)2016. 11. 28. 18:30

'embeded > arduino(genuino)' 카테고리의 다른 글

아두이노 스켈레톤 코드 및 부트로더  (0) 2017.02.11
avrdude arduino  (0) 2016.12.02
arduino clcd  (0) 2016.11.25
arduino nano 스펙(PWM)  (0) 2016.11.25
아두이노 프로세싱(언어)  (0) 2016.05.09
Posted by 구차니
embeded/arduino(genuino)2016. 11. 25. 20:46

4bit 8bit hd44780


[링크 : https://www.arduino.cc/en/Reference/LiquidCrystal]]

[링크 : https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay]

[링크 : http://playground.arduino.cc/Code/LCD]


근데 내가 가진건. hd44780 계열이 아니네...

sed1520 - cm04075

[링크 : https://www.devicemart.co.kr/1077090]

+ 2020.03.08

[링크 : https://blog.naver.com/ssw152003/220694366332]


s6a0069 / ks0066u - lc1628

[링크 : https://www.devicemart.co.kr/1075057]

'embeded > arduino(genuino)' 카테고리의 다른 글

avrdude arduino  (0) 2016.12.02
pwm ppm decode  (0) 2016.11.28
arduino nano 스펙(PWM)  (0) 2016.11.25
아두이노 프로세싱(언어)  (0) 2016.05.09
arduino firmata  (0) 2016.04.27
Posted by 구차니
embeded/arduino(genuino)2016. 11. 25. 10:04

6채널까지 가능

흐음..


조금 더 많았으면 좋았을텐데 조금 아쉽네


Microcontroller Atmel ATmega168 or ATmega328

Operating Voltage (logic level) 5 V

Input Voltage (recommended) 7-12 V

Input Voltage (limits) 6-20 V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 8

[링크 : https://www.arduino.cc/en/Main/ArduinoBoardNano]


아두이노 마이크로는 7채널이네

Microcontroller ATmega32U4

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limit) 6-20V

Digital I/O Pins 20

PWM Channels 7

Analog Input Channels 12

[링크 : https://www.arduino.cc/en/Main/ArduinoBoardMicro]


3,5,6,9,10,11 번이 PWM 이라고 했는데

아두이노 핀 번호라고 해야하나 어떻게 매핑되는진 매번 찾아야 할지도...


[링크 : https://forum.arduino.cc/index.php?topic=147582.0]

    [링크 : http://www.pighixxx.com/test/pinouts/boards/nano.pdf]

'embeded > arduino(genuino)' 카테고리의 다른 글

pwm ppm decode  (0) 2016.11.28
arduino clcd  (0) 2016.11.25
아두이노 프로세싱(언어)  (0) 2016.05.09
arduino firmata  (0) 2016.04.27
attiny2313 usb client  (0) 2016.04.19
Posted by 구차니
embeded/arduino(genuino)2016. 5. 9. 09:36

아두이노를 프로세싱으로 하려면..

jar 받아서 추가해주면 되는 듯?


[링크 : http://playground.arduino.cc/Interfacing/Processing]

[링크 : https://www.arduino.cc/en/Reference/Comparison]

'embeded > arduino(genuino)' 카테고리의 다른 글

arduino clcd  (0) 2016.11.25
arduino nano 스펙(PWM)  (0) 2016.11.25
arduino firmata  (0) 2016.04.27
attiny2313 usb client  (0) 2016.04.19
arduino usb joystic / atmega32u4  (0) 2016.04.19
Posted by 구차니