client.c 소스코드 #include #include #include #include #include #include #include #include #define BUF_SIZE 100 #define NAME_SIZE 20 void *send_msg(void * arg); void *recv_msg(void * arg); void error_handling(char *msg); char name[NAME_SIZE] = "[DEFAULT]"; char msg[BUF_SIZE]; int main(int argc, char *argv[]) { int sock; struct sockaddr_in serv_addr; pthread_t snd_thread, rcv_thread; void * thread_ret..
라즈베리파이 SOUND 1 소스코드 RASPBERRY-PI #include #include #include #define CS_ADC7 #define SPI_CHANNEL0 #define SPI_SPEED1000000 int adcRead(char adcChannel) { char buff[3]; int adcValue = 0; buff[0] = 0x06 |((adcChannel & 0x07) >>2); buff[1] = ((adcChannel &0x07)
라즈베리파이 CDS 조도센서 코드 1 #include #include #include #define CS_ADC7 #define SPI_CHANNEL0 #define SPI_SPEED1000000 int adcRead(char adcChannel) { char buff[3]; int adcValue = 0; buff[0] = 0x06 |((adcChannel & 0x07)>>2); buff[1] = ((adcChannel &0x07)
라즈베리파이 스텝모터 (STEP MOTER)소스코드 1 #include #include #include #define STEP_I2C_ADDR 0x20 #define IN_PORT0 0x00 #define IN_PORT1 0x01 #define OUT_PORT0 0x02 #define OUT_PORT1 0x03 #define POLARITY_IVE_PORT0 0x04 #define POLARITY_IVE_PORT1 0x05 #define CONFIG_PORT0 0X06 #define CONFIG_PORT1 0x07 const int aPhase_1[4] = {0x80, 0x40, 0x20, 0x10}; int fd; int main(void) { if((fd=wiringPiI2CSetup(STEP_I2C..
라즈베리파이 TEXTLCD 코드 1 #include #include #include int main(void) { wiringPiSetupGpio(); int lcd = lcdInit(2, 16, 4, 16, 26, 18, 27, 22, 23, 0, 0, 0, 0); lcdClear(lcd); lcdPosition(lcd, 0, 0); lcdPuts(lcd,"edgeiLAB"); lcdPosition(lcd,0,1); lcdPuts(lcd,"Hello World"); delay(1000); while(1) { } return 0; } 라즈베리파이 TEXTLCD 코드 2 #include #include #include const int pinEcho = 1; const int pinTrigger = 0; ..