2023年9月23日 星期六

Arduino 簡易訊號偵測,紅外線拼接

 void setup() {

  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(5,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(100); //延遲毫秒
  if(digitalRead(5)==0) //0=LOW
  // If no signal print collision detected
  Serial.println("Balls");
  if(digitalRead(5)==1) //1=HIGH
  //else
  // 11 If signal detected print collision detected
  Serial.println("No Balls.");
}

2023年9月17日 星期日

Arduino WeMos D1 R3 [入門] 開發板上控制製造呼吸燈

選板子

選板子前要先安裝ESP8266

打開 Arduino IDE,菜單 / 偏好設定,額外的開發板管理員網址打上:https://arduino.esp8266.com/stable/package_esp8266com_index.json
  1. https://ithelp.ithome.com.tw/upload/images/20190928/20120058J9MrrmsjkR.jpg

安裝ESP8266的方法






void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);    //必要
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BUILTIN, 1);
  delay(1000);
  digitalWrite(LED_BUILTIN, 0);
  delay(1000);    //必要不然迴圈會導致看不到效果
}


2023年9月13日 星期三

印加寶藏 機率自動化進行

本來想自稱AI

不過實際上只有加點機率

實現單人可以遊玩

機率電腦是固定數量的

https://scratch.mit.edu/projects/879030558/

GOOGLE不小心按了改成韓文,改變語言設定

  好奇點了上面的其他語言版本,結果搞了一會才改回中文,提供修改流程給需要的人