목록전체 글 (351)
printf("ho_tari\n");
#define V0 5.0 #define unit V0/1024.0 #define R1 1000.0 const int analogPin = A0; const int LED_0 = 3; void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(LED_0, OUTPUT); } void loop() { // put your main code here, to run repeatedly: int analogValue = analogRead(analogPin); float V2 = analogValue * unit; float R2 = (V2 * R1) / (V0 - V2); Serial.print(analogValu..
const uint8_t SW_0 = 2; const uint8_t LED_0 = 13; const uint8_t SW_1 = 3; const uint8_t LED_1 = 12; int led_flag_0 = 0; // 0 : OFF, 1 : ON int led_flag_1 = 0; // 사용자 함수 void SW0_Pressed(void) { if (led_flag_0 == 0) { led_flag_0 = 1; } else { led_flag_0 = 0; } } void SW1_Pressed(void) { if (led_flag_1 == 0) { led_flag_1 = 1; } else { led_flag_1 = 0; } } void setup() { // put your setup code here,..
const uint8_t SW_0 = 2; const uint8_t LED_0 = 13; const uint8_t SW_1 = 3; const uint8_t LED_1 = 12; int led_flag_0 = 0; // 0 : OFF, 1 : ON int led_flag_1 = 0; int pre_sw_0 = 0; int cur_sw_0 = 0; int pre_sw_1 = 0; int cur_sw_1 = 0; void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(SW_0, INPUT); pinMode(SW_1, INPUT); pinMode(LED_0, OUTPUT); pinMode(LED_1, OUTPU..
const int LED_0 = 13; const int LED_1 = 12; void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(LED_0, OUTPUT); pinMode(LED_1, OUTPUT); } void loop() { // put your main code here, to run repeatedly: if(Serial.available()){ char userInput[30] = {0, }; Serial.readBytesUntil('\n', userInput, 30); if(strcmp("L0_ON", userInput) == 0){ digitalWrite(LED_0, HIGH); } el..
const int LED[6] = {3, 5, 6, 9, 10, 11}; void setup() { // put your setup code here, to run once: //analogWrite(LED, 225); } void loop() { // put your main code here, to run repeatedly: for(int i = 0; i = 0; k--) { analogWrite(LED[i], k); delay(5); } analogWrite(LED[i], 0); } }
const int LED[8] = {2, 3, 4, 5, 6, 7, 8, 9}; void setup() { // put your setup code here, to run once: Serial.begin(115200); Serial.println(sizeof(LED)); Serial.println(sizeof(int)); for(int i = 0; i < (sizeof(LED)/sizeof(int)); i++) { pinMode(LED[i], OUTPUT); } } void loop() { // put your main code here, to run repeatedly: for(int i = 0; i < (sizeof(LED)/sizeof(int)); i++) { for(int i = 0; i < (..
void setup() { // put your setup code here, to run once: //printf("hello, world..!!"); Serial.begin(115200); Serial.println("Hello World..!!"); Serial.println(78); Serial.println(1.23456); Serial.println('N'); Serial.print("Hello World..!!"); Serial.print(78); Serial.print(1.23456); Serial.print('N'); Serial.println(); Serial.println(78, DEC); Serial.println(78, HEX); Serial.println(78, BIN); Se..