第一次,A 往 B 倒 A 容器內 1/2 水量
第二次,B 往 A 倒 B 容器內 1/3 水量
第三次,A 往 B 倒 A 容器內 1/4 水量
:
:
請問倒完第一百次水,A 容器裡面有多少水?
Albert and Bernard just become friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of 10 possible dates.
May 15, May 16, May 19,
June 17, June 18,
July 14, July 16,
August 14, August 15, August 17
Cheryl then tells Albert and Bernard separately the month and the day of her birthday respectively.
Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.
Bernard: At first I don't know when Cheryl's birthday is, but I know now.
Albert: Then I also know when Cheryl's birthday is.
So when is Cheryl's birthday?
ROSA 的基本系統底層已經可以精準計時運作,現在再加入 mBot 自走車驅動,並配合前文紅外線遙控,就可以前進後退左右轉。
// (C) 2015, Bridan Wang, CC BY-NC-SA 3.0 TW
// http://4rdp.blogspot.tw/search/label/ROSA%20(Arduino)
續前文,紅外線遙控很適合室內單機使用,一般距離五公尺內,還可以藉由牆面反射,按遙控器按鍵速度要求並不快,把前文的系統時間建起來後,將紅外線檢查放在 PROCESS_100ms()中就可以了,
// (C) 2015, Bridan Wang, CC BY-NC-SA 3.0 TW
// http://4rdp.blogspot.tw/search/label/ROSA%20(Arduino)
//
void PROCESS_100ms(void){
IR_CHECK();
}
之前曾提過ROSA 的時間系統,今天解析時間如何精確計數,
// (C) 2015, Bridan Wang, CC BY-NC-SA 3.0 TW
// http://4rdp.blogspot.tw/search/label/ROSA%20(Arduino)
//
unsigned long now;
void SYS_TIMER() {
static byte tm_10ms = 0;
static byte tm_100ms = 0;
static byte tm_1sec = 0;
while (millis() - now >= 10) {
now += 10;
tm_10ms++;
tm_100ms++;
tm_1sec++;
}
if (tm_1sec >= 100) {
tm_1sec -= 100;
PROCESS_1sec();
}
if (tm_100ms >= 10) {
tm_100ms -= 10;
PROCESS_100ms();
}
if (tm_10ms != 0) {
tm_10ms -= 1;
PROCESS_10ms();
}
}
void PROCESS_1sec(){
static byte led = 0;
//Serial.println(now);
led = 1 - led;
digitalWrite(13, led);
}
void PROCESS_100ms(){
}
void PROCESS_10ms(){
}
自己的繪圖 |