LuckyFace's Systems Lifescience

boolean and String, char 본문

Systems Neuroscience/ARDUINO functions

boolean and String, char

LuckyFace 2017. 4. 18. 16:05

int light = 0; // 0: no light, 1: cue light, 2: reward light

int lightType = 0; // 1: cue or reward period, 2: cue period, 3: reward period

boolean noC = false;

boolean reward = 0; // reward in current trial

boolean outcome = 0; // did mouse lick during delay period?

boolean waterClear = true; // did mouse lick after water reward? if not, do not give additional water

unsigned long times = 0; // current time

unsigned long timeStart = 0; // current epoch start time

boolean prevsensor = false; // previous sensor state

boolean cursensor = false; // current sensor state

String inString = "";



마찬가지로 이어지는 code들에는 int, unsigned long이 사용되었다.


새롭게 등장한 함수 boolean은 true/ false값을 갖는 변수를 설정한다. flag 변수라고도 한다함.


8비트, 1바이트 짜리 함수임. 영국의 수학자인 조지 불(George Boole)로부터 유래된 이름이라고 함.


boolean noC = false


이렇게 쓰는게 일반적인것 같은데


boolean reward = 0;


이건 뭘까. 0은 false, 1은 true인듯


char 함수는 문자를 저장할때 쓰는 함수이며, 1바이트라고 함. 기본적으로 ASCII code와 연결되어있음


char mychar = 'A' 이렇게.


String역시 문자열을 정의할때 쓰이는데, 여러문자로 되어있는 변수를 정의하고 사용할때 편하다함.




'Systems Neuroscience > ARDUINO functions' 카테고리의 다른 글

Serial 통신(2)  (0) 2017.04.19
void setup과 Serial 통신  (0) 2017.04.18
int, unsigned long  (0) 2017.04.18
#define  (0) 2017.04.18
ARDUINO function 정리  (0) 2017.04.18
Comments