embeded/arduino(genuino)2016. 3. 31. 19:03

엥? winavr에서도 안되었던가??

급 멘붕 ㄷㄷ


char *dtostrf(double val, signed char width, unsigned char prec, char *s)


Use this method to convert it to a C-Style string and then use sprintf, eg:


char str_temp[6];


/* 4 is mininum width, 2 is precision; float value is copied onto str_temp*/

dtostrf(temp, 4, 2, str_temp);

sprintf(temperature,"%s F", str_temp);

[링크 : http://stackoverflow.com/questions/27651012/arduino-sprintf-float-not-formatting]

[링크 : http://forum.arduino.cc/index.php?topic=175478.0]


[링크 : http://whiteat.com/bPDS_AVR/28406]

Posted by 구차니
embeded/arduino(genuino)2016. 3. 31. 10:30

필터는 나중에 적용하고..

걍.. atan()만 쓰면 끝나나?



double x_angle = -atan((double)ay/(double)az)*180.0 / 3.1416;

[링크 : http://hs36.tistory.com/19]


[링크 : http://pinkwink.kr/73]

[링크 : http://mechaworld.tistory.com/11]



+


2016/04/06 - [이론 관련] - 가속도계로 각도계산하기


Posted by 구차니
embeded/arduino(genuino)2016. 3. 31. 09:51

음.. 이제 좀 마음에 들게 되긴했는데..

각도를 어떻게 받고. 어떤 각도를 계산해야 하려나..


#include <avr/io.h>
#include <Wire.h>

#define I2C_ID  0x53 // ADXL-345

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin();

  // adxl345 initialize
  // power setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x2d));
    Wire.write(byte(0x18));
  Wire.endTransmission();

  // range setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x31));
    Wire.write(byte(0x09));
  Wire.endTransmission();
}

void loop() {
  // put your main code here, to run repeatedly:
  char str[30];
  char data[6];
  unsigned char idx = 0;
  short acc_x;
  short acc_y;
  short acc_z;

  // data request
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x32));
  Wire.endTransmission();
  Wire.requestFrom(0x53, 6);

  idx = 0;
  while (Wire.available())
    data[idx++] = Wire.read();

  acc_x = (data[1] << 8) | data[0];
  acc_y = (data[3] << 8) | data[2];
  acc_z = (data[5] << 8) | data[4];

  sprintf(str,"x:%6d y:%6d z:%6d",acc_x, acc_y, acc_z);
  Serial.println(str);

  delay(100);
}



FULL_RES 끄고(10bit output / 0~1023) +-16g로 출력

#include <avr/io.h>
#include <math.h>
#include <Wire.h>

#define I2C_ID  0x53 // ADXL-345

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin();

  // adxl345 initialize
  // power setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x2d));
    Wire.write(byte(0x18));
  Wire.endTransmission();

  // range setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x31));
    Wire.write(byte(0x03));
  Wire.endTransmission();
}

void loop() {
  // put your main code here, to run repeatedly:
  char str[30];
  char data[6];
  unsigned char idx = 0;
  short acc_x;
  short acc_y;
  short acc_z;
  double deg_x;
  double deg_y;

  // data request
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x32));
  Wire.endTransmission();
  Wire.requestFrom(0x53, 6);

  idx = 0;
  while (Wire.available())
    data[idx++] = Wire.read();

  acc_x = (data[1] << 8) | data[0];
  acc_y = (data[3] << 8) | data[2];
  acc_z = (data[5] << 8) | data[4];

  if(acc_z == 0)
  {
    deg_x = 0.0;
    deg_y = 0.0;
  }
  else
  {
    deg_x = atan((double)acc_x / (double)acc_z) * 57.2957;
    deg_y = atan((double)acc_y / (double)acc_z) * 57.2957;
  }
  
  sprintf(str,"x:%6d y:%6d z:%6d",acc_x, acc_y, acc_z);
  Serial.println(str);
  
  sprintf(str,"x:%d y:%d",(short)deg_x, (short)deg_y);
  Serial.println(str);

  delay(100);
}



#include <avr/io.h>
#include <math.h>
#include <Wire.h>

#define I2C_ID  0x53 // ADXL-345

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin();

  // adxl345 initialize
  // power setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x2d));
    Wire.write(byte(0x18));
  Wire.endTransmission();

  // range setting
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x31));
    Wire.write(byte(0x02));
  Wire.endTransmission();
}

void loop() {
  // put your main code here, to run repeatedly:
  char str[30];
  char str_x[15];
  char str_y[15];
  char data[6];
  unsigned char idx = 0;
  short acc_x;
  short acc_y;
  short acc_z;
  double deg_x;
  double deg_y;

  // data request
  Wire.beginTransmission(I2C_ID);
    Wire.write(byte(0x32));
  Wire.endTransmission();
  Wire.requestFrom(0x53, 6);

  idx = 0;
  while (Wire.available())
    data[idx++] = Wire.read();

  acc_x = (data[1] << 8) | data[0];
  acc_y = (data[3] << 8) | data[2];
  acc_z = (data[5] << 8) | data[4];

  if(acc_z == 0)
  {
    deg_x = 0.0;
    deg_y = 0.0;
  }
  else
  {
    deg_x = atan((double)acc_x / (double)acc_z) * 57.2957;
    deg_y = atan((double)acc_y / (double)acc_z) * 57.2957;
  }
  
  sprintf(str,"x:%6d y:%6d z:%6d",acc_x, acc_y, acc_z);
  Serial.println(str);

  dtostrf(deg_x, 4,2, str_x);
  dtostrf(deg_y, 4,2, str_y);
  sprintf(str,"x:%s y:%s",str_x, str_y);
  Serial.println(str);

  delay(100);
}


Posted by 구차니
embeded/arduino(genuino)2016. 3. 30. 19:38

이걸 한번... 아두이노 용으로 변환해서 해봐야지..

일단 0x53이고

파워업 리셋시 센서 작동하지 않으므로


Rate는 0x0A(1010b)로 설정되어 100Hz 표준 i2c 속도의 출력 속도에 맞춰 지는건가?


0x2d 레지스터에 0x18을 넣어

AUTO_SLEEP 과 Measure를 설정해 값을 측정하도록 한다.

AUTO_SLEEP은 좀더 봐야 할 듯


0x31에서는 측정할 가속도의 범위를 설정하는데

기본값은 0x00으로 Range +-2g를 측정하게 된다.

+

2016.03.31

FULL_RES=1의 경우 무조건 4mg=1 로 계산되고 Range에 영향을 받아 출력되는 범위가 달라진다.

예를 들어 +2g로 Range 설정시 256으로 출력되며 1g(4mg*256=1024mg=1g) 흔들어서나오는 값이

+-512를 넘지 못한다(512*4=2048=2g)


FULL_RES=0의 경우 Range를 0x03으로 하면 8g이고 32값이 나오게 된다(1g에 대한 값)

즉, 최대 범위에 대해서 0~1023으로 scaling된 값이 나오게 된다.

+


그리고는 0x32~0x37까지 6바이트에 대해서 x,y,z 축에 대한 값을 받아 온다.

DATAX0이 LSB쪽

DATAX1이 MSB쪽이다.


#include <stdio.h>
#include <stdlib.h>
#include <linux/i2c-dev.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>

int main(int argc, char **argv)
{
   printf("**** ADXL435 example program ****\n");
   
   int fd;                                          // File descrition
   char *fileName = "/dev/i2c-1";                        // Name of the port we will be using
   int  address = 0x53;                              // Address of the SRF02 shifted right one bit
   char buf[6];                              // Buffer for data being read/ written on the i2c bus
   short x,y,z;

   if ((fd = open(fileName, O_RDWR)) < 0) {               // Open port for reading and writing
      printf("Failed to open i2c port\n");
      exit(1);
   }
   
   if (ioctl(fd, I2C_SLAVE, address) < 0) {               // Set the port options and set the address of the device we wish to speak to
      printf("Unable to get bus access to talk to slave\n");
      exit(1);
   }

   buf[0] = 0x2d;                                       // Commands for performing a ranging
   buf[1] = 0x18;
   
   if ((write(fd, buf, 2)) != 2) {                        // Write commands to the i2c port
      printf("Error writing to i2c slave\n");
      exit(1);
   }

   buf[0] = 0x31;                                       // Commands for performing a ranging
   buf[1] = 0x09;
   
   if ((write(fd, buf, 2)) != 2) {                        // Write commands to the i2c port
      printf("Error writing to i2c slave\n");
      exit(1);
   }

                                       // This sleep waits for the ping to come back
while(true){   

   buf[0] = 0x32;                                       // This is the register we wish to read from
   if ((write(fd, buf, 1)) != 1) {                        // Send the register to read from
      printf("Error writing to i2c slave\n");
      exit(1);
   }
   

usleep(1000);
  memset(&buf,0,sizeof(buf));

   if (read(fd, buf, 6) != 6) {                        // Read back data into buf[]
      printf("Unable to read from slave\n");
      exit(1);
   }
   else { x=y=z=0;
//               memset(&buf,0,sizeof(buf));

      x = ((short)buf[1]<<8) | (short) buf[0]; 
       y = ((short)buf[3]<<8) | (short) buf[2];
       z = ((short)buf[5]<<8) | (short) buf[4];
       std::cout<<"x:"<<x<<"\ty:"<<y<<"\tz:"<<z<<std::endl;
   }
}
   return 0;

} 


2015/08/24 - [개소리 왈왈/라즈베리 파이(rpi)] - 라즈베리 파이 i2c ADXL345 3축 가속도 센서


값이 바뀌긴 한데 수치만으로는 헷갈리네..


#include <avr/io.h> #include <Wire.h> #define I2C_ID  0x53 // ADXL-345 void setup() {  // put your setup code here, to run once:  Wire.begin();  Serial.begin(9600); } void loop() {  // put your main code here, to run repeatedly:  char str[30];  char data[6];  unsigned char idx = 0;  short acc_x;  short acc_y;  short acc_z;  // power setting  Wire.beginTransmission(I2C_ID);    Wire.write(byte(0x2d));    Wire.write(byte(0x18));  Wire.endTransmission();  // range setting  Wire.beginTransmission(I2C_ID);    Wire.write(byte(0x31));    Wire.write(byte(0x09));  Wire.endTransmission();  // data request  Wire.beginTransmission(I2C_ID);    Wire.write(byte(0x32));  Wire.endTransmission();  Wire.requestFrom(0x53, 6);  idx = 0;  while (Wire.available())    data[idx++] = Wire.read();  acc_x = (data[1] << 8) | data[0];  acc_y = (data[3] << 8) | data[2];  acc_z = (data[5] << 8) | data[4];  sprintf(str,"x:%6d y:%6d z:%6d",acc_x, acc_y, acc_z);  Serial.println(str);  delay(100); }


#include <avr/io.h> #include <Wire.h> #define I2C_ID  0x53 // ADXL-345 void setup() {  // put your setup code here, to run once:  Wire.begin();  Serial.begin(115200); } void loop() {  // put your main code here, to run repeatedly:  char str[30];  char data[6];  unsigned char idx = 0;  short acc_x;  short acc_y;  short acc_z;  sprintf(str,"%c%c",0x2d,0x18);  // power setting  Wire.beginTransmission(I2C_ID);    Wire.write(str);  Wire.endTransmission();  sprintf(str,"%c%c",0x31,0x09);  // range setting  Wire.beginTransmission(I2C_ID);    Wire.write(str);  Wire.endTransmission();  sprintf(str,"%c",0x32);         // data request  Wire.beginTransmission(I2C_ID);    Wire.write(str);  Wire.endTransmission();  Wire.requestFrom(0x53, 6);  idx = 0;  while (Wire.available())    data[idx++] = Wire.read();  acc_x = (data[1] << 8) | data[0];  acc_y = (data[3] << 8) | data[2];  acc_z = (data[5] << 8) | data[4];  sprintf(str,"x:%6d y:%6d z:%6d",acc_x, acc_y, acc_z);  Serial.println(str);  delay(100); }


먼가 값은 나온다.


A4 -> SDA

A5 -> SCL

5V -> VCC

GND -> GND

이렇게 4줄 연결 하고 끝


이제 이걸.. 수학 공식을 이용해서 각도로 계산을 어떻게 한다냐...

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

가속도계 각도 계산..  (2) 2016.03.31
아두이노 nano + ADXL345  (0) 2016.03.31
아두이노 나노 pinout / atmega328p  (0) 2016.03.30
아두이노 avr 헤더사용하기 / PUD  (0) 2016.03.30
아두이노 / avr bootloader  (0) 2016.03.30
Posted by 구차니
embeded/arduino(genuino)2016. 3. 30. 16:58

얘네는 디지털 핀 쪽

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.

        These pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip.

External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value,

                      a rising or falling edge, or a change in value. See the attachInterrupt() function for details.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which,

      although provided by the underlying hardware, is not currently included in the Arduino language.

LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on,

           when the pin is LOW, it's off.


얘는 아날로그 핀 쪽

I2C: A4 (SDA) and A5 (SCL). Support I2C (TWI) communication using the Wire library

      (documentation on the Wiring website).

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





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


일단.. I2C는 1채널뿐이군

SPI: 2

TWI (I2C): 1

UART: 1

ADC Channels: 8

ADC Resolution (bits): 10

ADC Speed (ksps): 15

Temp. Sensor: Yes

SRAM (kBytes): 2

EEPROM (Bytes): 1024

Self Program Memory: Yes

Timers: 3


[링크 : http://www.atmel.com/devices/atmega328p.aspx]

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

아두이노 nano + ADXL345  (0) 2016.03.31
ADXL345 소스 분석 및 아두이노 용으로 변환  (0) 2016.03.30
아두이노 avr 헤더사용하기 / PUD  (0) 2016.03.30
아두이노 / avr bootloader  (0) 2016.03.30
arduino i2c 예제  (0) 2016.03.30
Posted by 구차니
embeded/arduino(genuino)2016. 3. 30. 16:31

머 대단한건 아니고.. 그냥

#include <avr/io.h> 

추가하면 된다.

+

2016.03.31

기본적으로 추가되어 있어서 굳이 include 안해도 된다

+


AVR-GCC: "C:\path-to-arduino\hardware\tools\avr\bin"

GNU make "C:\path-to-arduino\hardware\tools\avr\utils\bin"

AVR Header files "C:\path-to-arduino\hardware\tools\avr\avr\include"

AVRDude "C:\path-to-arduino\hardware\tools\avr\bin"

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


그나저나.. atmega128이랑 비슷할줄 알았는데.. 헤더를 보니 완전 딴판이네..


#include <avr/io.h>

void setup() {  // put your setup code here, to run once:  Serial.begin(115200); } void loop() {  // put your main code here, to run repeatedly:  char str[10];  sprintf(str, "%04X",MCUCR);  Serial.println(str); } 


PUD 값 보려니.. 얘는 0x000으로 나오는거 봐서는

PUD는 기본적으로 0이니까.. pull up disable 이 false

즉, pull up은 enable 되어 있는 것 같은데..



음.. 값이 끌려 다니게 하려면

pud 기본값에, ddr input 설정에, 포트에 값을 입력임에도 불구하고 high로 놔주어야 하는건가?

tri-state는 쇼트 안나게 저항을 퐉! 올려주는거라고 하니.. 통신이 안될테고

결론은 DDR=0; PORT=1; 해야 하려나?



[링크 : http://www.atmel.com/...328-328p_datasheet_complete.pdf]

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

ADXL345 소스 분석 및 아두이노 용으로 변환  (0) 2016.03.30
아두이노 나노 pinout / atmega328p  (0) 2016.03.30
아두이노 / avr bootloader  (0) 2016.03.30
arduino i2c 예제  (0) 2016.03.30
아두이노 on ubuntu 15.10  (0) 2016.03.28
Posted by 구차니
embeded/arduino(genuino)2016. 3. 30. 15:17

예전에 적었던 건데.. 한번쯤은 올려 봐야겟지?

아무튼 부트로더를 올릴려면 ISP 프로그래머가 반드시 필요 하다고 한다.


Burning the Bootloader

To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer), USBtinyISP or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port.

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

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


Self Programming

[링크 : http://www.atmel.com/images/doc1644.pdf]


Serial Bootloader User Guide

[링크 : http://www.atmel.com/images/...serial-bootloader-user-guide_application-note.pdf]

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

아두이노 나노 pinout / atmega328p  (0) 2016.03.30
아두이노 avr 헤더사용하기 / PUD  (0) 2016.03.30
arduino i2c 예제  (0) 2016.03.30
아두이노 on ubuntu 15.10  (0) 2016.03.28
아두이노 빌드 프로세스 & c/cpp  (0) 2016.03.28
Posted by 구차니
embeded/arduino(genuino)2016. 3. 30. 13:58

마침.. 아두이노 nano 2개가 있으니 해볼까?

i2c는 버스라서 동일한 라인에 선을 연결해주면 끝(SCL/SDA)


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

Posted by 구차니
embeded/arduino(genuino)2016. 3. 28. 20:04

시리얼 포트 쓰려면 dialout 그룹에 추가해야 하니 추가해주세열?



윈도우용으로 받는 신버전 보다 낮은지 먼가 메뉴가 다르다.

1.6.8 인거 같은데.. 리눅스 용은 버전이 왜 이모양이야? ㄷㄷ


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

아두이노 / avr bootloader  (0) 2016.03.30
arduino i2c 예제  (0) 2016.03.30
아두이노 빌드 프로세스 & c/cpp  (0) 2016.03.28
아두이노 나노 - LED 블링크 예제  (0) 2016.03.27
아두이노 나노 - 시리얼 테스트  (3) 2016.03.27
Posted by 구차니
embeded/arduino(genuino)2016. 3. 28. 11:17


c/cpp 지원함


Can I program the Arduino board in C? 

In fact, you already are; the Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs supported by avr-g++ should work in Arduino. For more details, see the page on the Arduino build process.

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



아두이노 켜면 뜨는 sketch 파일은 바로 빌드 되는게 아니라 여러 단계를 거쳐서 빌드 됨

일단 소스를 보면.. 기본골격이 setup() / loop() 인데

아마도... 이런 구조로 변환하려나?


#include "board.h"

#include "wiring.h"

#define F_CPU 16000000


extern void setup();

extern void loop();

int main()

{

setup();

while(1)

{

// main loop

loop();

// event handler - not interrupt

serial_event();

}

} 

[링크 : https://www.arduino.cc/en/Hacking/BuildProcess]

[링크 : https://www.arduino.cc/en/Hacking/Preferences]



+

2016.03.28


빌드 메시지

/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/eightanaloginputs /tmp/build3729038704914021233.tmp/SerialEvent.cpp -o /tmp/build3729038704914021233.tmp/SerialEvent.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/WInterrupts.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/wiring_pulse.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/wiring_digital.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/wiring_analog.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/malloc.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/realloc.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/wiring.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/wiring_shift.c.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/CDC.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/Stream.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/main.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/WMath.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/HID.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/WString.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/HardwareSerial.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/IPAddress.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/USBCore.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/new.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/Tone.cpp.o

  Using previously compiled: /tmp/build3729038704914021233.tmp/Print.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/WInterrupts.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/wiring_pulse.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/wiring_digital.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/wiring_analog.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/malloc.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/realloc.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/wiring.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/wiring_shift.c.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/CDC.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/Stream.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/main.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/WMath.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/HID.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/WString.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/HardwareSerial.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/IPAddress.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/USBCore.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/new.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/Tone.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build3729038704914021233.tmp/core.a /tmp/build3729038704914021233.tmp/Print.cpp.o

/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o /tmp/build3729038704914021233.tmp/SerialEvent.cpp.elf /tmp/build3729038704914021233.tmp/SerialEvent.cpp.o /tmp/build3729038704914021233.tmp/core.a -L/tmp/build3729038704914021233.tmp -lm

/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/build3729038704914021233.tmp/SerialEvent.cpp.elf /tmp/build3729038704914021233.tmp/SerialEvent.cpp.eep

/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /tmp/build3729038704914021233.tmp/SerialEvent.cpp.elf /tmp/build3729038704914021233.tmp/SerialEvent.cpp.hex

바이너리 스케치 사이즈: 3,566 바이트 (최대 30,720 바이트) 


$ cat main.cpp.d

/tmp/build3729038704914021233.tmp/main.cpp.o: \

 /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp \

 /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \

 /usr/share/arduino/hardware/arduino/cores/arduino/new.h \

 /usr/share/arduino/hardware/arduino/variants/eightanaloginputs/pins_arduino.h \

 /usr/share/arduino/hardware/arduino/variants/eightanaloginputs/../standard/pins_arduino.h 


$ cat /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp

#include <Arduino.h>


int main(void)

{

        init();


#if defined(USBCON)

        USBDevice.attach();

#endif


        setup();


        for (;;) {

                loop();

                if (serialEventRun) serialEventRun();

        }


        return 0;

} 


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

arduino i2c 예제  (0) 2016.03.30
아두이노 on ubuntu 15.10  (0) 2016.03.28
아두이노 나노 - LED 블링크 예제  (0) 2016.03.27
아두이노 나노 - 시리얼 테스트  (3) 2016.03.27
아두이노 나노 v3.0 / v3.1  (0) 2016.03.27
Posted by 구차니