embeded/arduino(genuino)2025. 10. 11. 21:01

아두이노 나노 v3.0 이고, 아래의 셋팅으로 진행함

 

라이브러리 매니저에서 servo / arduino 를 설치하고

 

귀찮으니 D5/D6/D9/D10 옮겨가며 해보는걸로 하고, 일단은 날로 먹기 모드 ㅋㅋ

 

아래 코드를 대충 작성해서 넣어주면

#include <Servo.h>

Servo myservo[4];
String inputString = "";
bool stringComplete = false; 
unsigned char pwm_ch[4] = {5,6,9,10};
unsigned char pwm_val[4] = {127,127,127,127};

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello");
  
  inputString.reserve(200);

  for(int idx = 0;idx < 4;idx++)
  {
      myservo[idx].attach(pwm_ch[idx]);
      myservo[idx].write(pwm_val[idx]);
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  if (stringComplete) {
    char data[64] = "";
    inputString.toCharArray(data, inputString.length());
    sscanf(data, "%d,%d,%d,%d\n",
      &(pwm_val[0]),
      &(pwm_val[1]),
      &(pwm_val[2]),
      &(pwm_val[3]));

    char res[64] = "";
    sprintf(res, "get %d %d %d %d\n", pwm_val[0], pwm_val[1], pwm_val[2], pwm_val[3]);
    Serial.print(res);

    Serial.print(inputString);
    // clear the string:
    inputString = "";
    stringComplete = false;

    for(int idx = 0;idx < 4;idx++)
    {
      if(pwm_val[idx] > 255) pwm_val[idx] = 255;
      if(pwm_val[idx] < 1) pwm_val[idx] = 1;
      myservo[idx].write(pwm_val[idx]); 
    }
  }
}

void serialEvent()
{
  while(Serial.available())
  {
    char inChar = (char)Serial.read();
    inputString += inChar;
    if (inChar == '\n')
    {
      stringComplete = true; 
    }
  }
}

 

최초 구동시 Hello가 나오고

콤마로 4개의 값을 넣어주면 된다. 개별 범위는 0~255

[링크 : https://docs.arduino.cc/learn/electronics/servo-motors/]

 

그나저나 pinMode 설정과 analogWrite() 로는 정상적으로 작동하지 않네.. 머가 문제일까?

int ledPin = 9;      // LED connected to digital pin 9
int analogPin = A0;  // potentiometer connected to analog pin A0
int val = 0;         // variable to store the read value

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

void loop() {
  val = analogRead(analogPin);  // read the input pin
  analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
}

[링크 : https://support.arduino.cc/hc/en-us/articles/9350537961500-Use-PWM-output-with-Arduino]

 

그래서 찾아보니

servo는 대부분 pwm이 아니라는 이야기. 아.. 그렇지! pwm이 아니지?!

[링크 : https://forum.arduino.cc/t/analogwrite-vs-servo-write/370486/3]

[링크 : https://forum.arduino.cc/t/servo-with-analogwrite/438505/7]

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

아두이노 시리얼 이벤트 핸들러  (0) 2025.10.09
퀄컴 아두이노 인수  (0) 2025.10.08
아두이노 sd 카드  (0) 2025.08.24
skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
HW-504 이상해..  (0) 2025.08.02
Posted by 구차니
embeded/arduino(genuino)2025. 10. 9. 22:44

예제로 맨날 폴링만 보다보니 인터럽트가 될거라 생각을 못했네..

/*
  SerialEvent occurs whenever a new data comes in the hardware serial RX. This
  routine is run between each time loop() runs, so using delay inside loop can
  delay response. Multiple bytes of data may be available.
*/
void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the inputString:
    inputString += inChar;
    // if the incoming character is a newline, set a flag so the main loop can
    // do something about it:
    if (inChar == '\n') {
      stringComplete = true;
    }
  }
}

 

[링크 : https://docs.arduino.cc/built-in-examples/communication/SerialEvent]

[링크 : https://juahnpop.tistory.com/85]

[링크 : https://m.blog.naver.com/dhtpals32123/222270427302]

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

arduino nano로 4채널 pwm 출력하기  (0) 2025.10.11
퀄컴 아두이노 인수  (0) 2025.10.08
아두이노 sd 카드  (0) 2025.08.24
skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
HW-504 이상해..  (0) 2025.08.02
Posted by 구차니
embeded/arduino(genuino)2025. 10. 8. 22:15

어떤 의미로 놀랍긴 한데.. wiring 기반으로 발전해왔고

라즈베리에서도 wiring을 잘 썼는데

퀄컴이 아두이노 인수하면서 어떻게 될지가 좀 조심스러워진다.

[링크 : https://news.hada.io/topic?id=23502]

[링크 : https://www.techpowerup.com/341673/qualcomm-to-acquire-arduino]

 

눈에 띄는건.. Adreno GPU 3D 가속기와 카메라 2개 가능, cortex-M33 160Mhz 별도 장착.

Core
Qualcomm Dragonwing™ QRB2210
Includes the powerful Qualcomm Dragonwing™ QRB2210 processor featuring:
Quad-core Arm® Cortex®-A53 @ 2.0 GHz
Adreno GPU 3D graphics accelerator
2x ISP (13 MP + 13 MP or 25 MP) @ 30 fps
Overview
Microcontroller
STM32U585 Arm® Cortex®-M33 32-bit MCU
The UNO Q integrates the STM32U585 microcontroller featuring:
Arm® Cortex®-M33 up to 160 MHz
2 MB flash memory
786 kB SRAM
Floating Point Unit

[링크 : https://docs.arduino.cc/hardware/uno-q/]
[링크 : https://www.arduino.cc/product-uno-q] UNO Q

 

가격이 낮아질것 같진 않지만.. 일단 아두이노가 라즈베리를 타겟으로 하는 가격을 보여주는 듯.

[링크 : https://store-usa.arduino.cc/products/uno-q]

 

 

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

arduino nano로 4채널 pwm 출력하기  (0) 2025.10.11
아두이노 시리얼 이벤트 핸들러  (0) 2025.10.09
아두이노 sd 카드  (0) 2025.08.24
skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
HW-504 이상해..  (0) 2025.08.02
Posted by 구차니
embeded/arduino(genuino)2025. 8. 24. 23:29

api는 좀 찾아봐야겠다.

나중에 esp32 + sd 카드 + 보조배터리 + LCD + GPS + 가속도센서 + 자이로 + 콤파스

하면 먼가 재미난게 나올려나?

 

[링크 : https://blog.naver.com/roboholic84/221789023195]

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

아두이노 시리얼 이벤트 핸들러  (0) 2025.10.09
퀄컴 아두이노 인수  (0) 2025.10.08
skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
HW-504 이상해..  (0) 2025.08.02
ads1115 복수 장치 읽기  (0) 2025.08.02
Posted by 구차니
embeded/arduino(genuino)2025. 8. 7. 18:19

예전에 파트명이랑 데이터 시트도 찾지 못했던 부품인데

이래저래 안되서 과감하게 파괴!

우측에 빨간색 원이 있는 쪽이 캔의 구멍을 통해 들어오는 소리에 반응을 하나보다.

그리고 좌측의 6개 구멍을 통해 무엇을 하는거 같진 않고

FET를 통해 전기가 증폭되어 출력을 하는걸려나?

 

FET 로 추정되는 녀석 파트번호

 

온세미꺼라는 보장은 없지만 마킹은 맞는거 같기도..

 

B 랭크 부품인가?

Drain Current 150~240uA 전류가 더 높게 출력되네? 범위도 넓고

다만 gain 쪽은 -3.8 dB로 A 랭크의 -5.0 dB에 비하면 낮다.

 

[링크 : https://www.alldatasheet.com/datasheet-pdf/view/546130/ONSEMI/2SK596S-B.html]

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

퀄컴 아두이노 인수  (0) 2025.10.08
아두이노 sd 카드  (0) 2025.08.24
HW-504 이상해..  (0) 2025.08.02
ads1115 복수 장치 읽기  (0) 2025.08.02
패시브 부저  (0) 2025.08.01
Posted by 구차니
embeded/arduino(genuino)2025. 8. 2. 14:58

머지? 왜 Y축은 전원이 연결이 안되서

가변저항 값은 맞는데 ADC에서 읽히지 않게 되어 있는걸까?

그래서 싸게 파는건가...?

 

새로 뜯으면 이렇게 생겨먹었는데 R5의 땜이 없는 곳이 X 축 저항 한쪽에 VCC와 연결되어 있다.

R5의 땜이 있는 곳은 GND와 Y축 가변저항의 상단 단자와 연결되어 있어서

이걸 쇼트 시키면 VCC - GND 쇼트되어버려서 쓸 수 없다.

 

그런 이유로 속편하게(?) VCC - Y 축 가변저항에 바로 점퍼를 연결!

 

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

아두이노 sd 카드  (0) 2025.08.24
skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
ads1115 복수 장치 읽기  (0) 2025.08.02
패시브 부저  (0) 2025.08.01
nRF24L01 복수 장치 통신  (0) 2025.07.29
Posted by 구차니
embeded/arduino(genuino)2025. 8. 2. 09:39

아.. 여러개 사서 해볼걸 ㅠㅠ

 

 

[링크 : https://www.ti.com/lit/ds/symlink/ads1115.pdf]

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

skt-444 콘덴서 마이크 모듈 분해  (0) 2025.08.07
HW-504 이상해..  (0) 2025.08.02
패시브 부저  (0) 2025.08.01
nRF24L01 복수 장치 통신  (0) 2025.07.29
오랫만에 부품지름  (0) 2025.07.29
Posted by 구차니
embeded/arduino(genuino)2025. 8. 1. 23:29

테스트 해보니

waveform generator로 생성한 것 대로 음이 바뀐다.

다만 볼륨은 duty로 바뀌지 않고 음색이 바뀌는 느낌 혹은 주파수 변화라고 해야하나...

 

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=C441109005&frm3=V2]

 

의외로 주파수가 좁다?

그리고 작동이 3~5V 라는데 1V 해서 소리가 났다는게 함정(작지만)

SKU: MDU1126
Brief Data:
 Oscillation Frequency: 1500~2500Hz.
 Connector Pitch: 2.54mm.
 Operation Voltage: 3~5V.
 Color: Black.
 Operating Temperature: -20 ~ +70°C.
 Dimension (L x W): 1.85 x 1.5 cm.

[링크 : https://www.handsontec.com/dataspecs/module/passive%20buzzer.pdf]

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

HW-504 이상해..  (0) 2025.08.02
ads1115 복수 장치 읽기  (0) 2025.08.02
nRF24L01 복수 장치 통신  (0) 2025.07.29
오랫만에 부품지름  (0) 2025.07.29
1.8인치 TFT LCD with SDcard  (0) 2024.10.18
Posted by 구차니
embeded/arduino(genuino)2025. 7. 29. 11:46

multiple slave 모드라는걸 지원해서, 1:6 까지 뿌릴수 있다고 한다.

 

[링크 : https://arduinomaker.tistory.com/38]

[링크 : https://blog.naver.com/mapes_khkim/221882273978]

 

Key Features
• Worldwide 2.4GHz ISM band operation
• Up to 2Mbps on air data rate
• Ultra low power operation
• 11.3mA TX at 0dBm output power
• 12.3mA RX at 2Mbps air data rate
• 900nA in power down
• 22µA in standby-I
• On chip voltage regulator
• 1.9 to 3.6V supply range
• Enhanced ShockBurst™
• Automatic packet handling
• Auto packet transaction handling
• 6 data pipe MultiCeiver™
• Air compatible with nRF2401A, 02, E1 and E2
• Low cost BOM
• ±60ppm 16MHz crystal
• 5V tolerant inputs
• Compact 20-pin 4x4mm QFN package


[링크 : https://cdn.sparkfun.com/datasheets/Wireless/Nordic/nRF24L01_Product_Specification_v2_0.pdf]

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

ads1115 복수 장치 읽기  (0) 2025.08.02
패시브 부저  (0) 2025.08.01
오랫만에 부품지름  (0) 2025.07.29
1.8인치 TFT LCD with SDcard  (0) 2024.10.18
아두이노 FFB 휠 소스코드  (0) 2024.10.11
Posted by 구차니
embeded/arduino(genuino)2025. 7. 29. 11:13

아니 쓰지도 못하고 재워두는거 왜 사는지 나도 이해가 안되지만 일단 지름 ㅋㅋㅋ

nRF24는 있어서 사려다가 패스

 

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

패시브 부저  (0) 2025.08.01
nRF24L01 복수 장치 통신  (0) 2025.07.29
1.8인치 TFT LCD with SDcard  (0) 2024.10.18
아두이노 FFB 휠 소스코드  (0) 2024.10.11
arducam esp8266 https post 예제  (0) 2024.01.31
Posted by 구차니