This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 초음파 센서 예제 | |
* (by - http://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/) | |
* VCC - 5v, GND - GND, Trig - 9, Echo - 10 | |
*/ | |
// 핀 번호 정의 (변경가능) | |
const int trigPin = 9; | |
const int echoPin = 10;// 변수 정의 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* rbg led 예제 | |
* (by - https://learn.adafruit.com/adafruit-arduino-lesson-3-rgb-leds/colors) | |
* | |
* 가장 긴다리 - gnd, 나머지 다리들 - 9, 10, 11(저항 연결) | |
* https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-3-driving-an-rgb-led - 참고 | |
* | |
* 0xffccff 의 색을 표현하고 싶다면, setcolor(0xff, 0xcc, 0xff)로 표현 할 수 있음 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ARM CODE (STM32F103) | |
// 헤더 파일 추가 | |
#include <stm32f10x.h> | |
#include <stm32f10x_rcc.h> | |
#include <stm32f10x_gpio.h> | |
#include <stm32f10x_tim.h> | |
// 출력 포트 (PA6) | |
#define GPIO_PERIPH RCC_APB2Periph_GPIOA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AVR CODE (ATMEGA2560) | |
// 헤더 파일 추가 | |
#include <avr/io.h> | |
// 출력 포트 (PB5, OC1A) | |
#define PWM_PIN 5 | |
#define PWM_VALUE 1000 | |
// 타이머 설정(250Hz) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ARDUINO CODE | |
// 출력 포트 (D9) | |
#define PWM_PIN 9 | |
// pwm 출력 값[0;255] | |
#define PWM_VALUE 128 | |
void setup() | |
{ | |
// 포트 출력 설정 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ARDUINO CODE | |
// 출력 포트 (D9) | |
#define PWM_PIN 9 | |
// pwm 출력 값[0;255] | |
#define PWM_VALUE 128 | |
void setup() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
printf("Hello World!\n"); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* stm32_flash.ld for stm32f103c8 */ | |
/* 스택 시작 주소, 일반적으로 (RAM의 시작주소 + 크기)를 사용한다 */ | |
_estack = 0x20002000; | |
_Min_Heap_Size = 0; | |
_Min_Stack_Size = 0x800; /* RAM의 크기 고려한 필요한 스택(RAM)의 크기 */ | |
MEMORY | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stm32f10x_conf.h" | |
void _delay(volatile uint32_t ms) { | |
ms *= 8000; | |
while(ms--); | |
} | |
int main(void) { | |
/* LED Pin : PC13 */ | |
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "locker.h" | |
LockerClass::LockerClass(int maxNum) | |
: _lockerMaxNum(maxNum) { | |
_lockerInfo = new lockerInfo_t[_lockerMaxNum]; | |
} | |
LockerClass::~LockerClass() { | |
delete[] _lockerInfo; | |
_lockerInfo = NULL; |
NewerOlder