This file contains 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> | |
void main() | |
{ | |
printf("hello"); | |
} |
This file contains 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
import processing.serial.*; | |
import processing.net.*; | |
Serial wifi_port; | |
Server wifi_server; | |
Client wifi_client; | |
String in_msg; | |
char indata; | |
PFont f; |
This file contains 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
const int ledPin = 13; | |
char indata; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { | |
if(Serial.available()) { |
This file contains 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
String inString = ""; // string to hold input | |
int val; | |
int latchPin = 8; | |
int clockPin = 12; | |
int dataPin = 11; | |
void setup() { | |
pinMode(latchPin, OUTPUT); | |
pinMode(clockPin, OUTPUT); |
This file contains 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
int R = 11; | |
int G = 10; | |
int B = 9; | |
void setup() { | |
pinMode(R,OUTPUT); | |
pinMode(G,OUTPUT); | |
pinMode(B,OUTPUT); | |
Serial.begin(9600); | |
} |
This file contains 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
import processing.serial.*; | |
Serial port; | |
PImage img; | |
void setup() { | |
port = new Serial(this,Serial.list()[0],9600); | |
size(800,600); | |
img = loadImage("color.png"); | |
image(img,0,0,width,height); | |
} |
This file contains 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 <SoftwareSerial.h> | |
SoftwareSerial BTSerial(3,2); //Rx, Tx | |
void setup() { | |
Serial.begin(9600); | |
BTSerial.begin(9600); | |
} | |
void loop() { | |
if(BTSerial.available()) { |
This file contains 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
#define PI 3.141592 | |
#define piezoPin 12 //피에조 스피커 연결 핀 번호 | |
float sinVal; //정현파 값 저장 | |
int toneVal; //경보음 발생을 위한 값 저장 | |
void setup() | |
{ | |
pinMode(piezoPin, OUTPUT);//9번핀을 출력으로 설정 | |
} | |
void loop() |
This file contains 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
//millis()함수 사용 | |
long time = millis() ; | |
int flag = 1000; | |
void setup() { | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
if (millis() > time + flag) { |
This file contains 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
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
int sensorVal = analogRead(A0); | |
sensorVal = map(sensorVal,0,1023,0,253); | |
Serial.write(sensorVal); | |
delay(10); | |
} |
OlderNewer