Close

2023-11-23

A project log for M8B

Magic 8 Ball + User Guide

isaurejarryisaure.jarry 11/23/2023 at 09:160 Comments

We uploaded the following videos on our feed:

We wrote the code (working) for the loading LEDs of the ball :

const int touchPin = 33;  
const int redPin = 13;    
const int bluePin = 2;  
const int greenPin = 15;  
void setup() {

  pinMode(touchPin, INPUT);
  pinMode(redPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  digitalWrite(redPin, LOW);    
  digitalWrite(bluePin, LOW);  
  digitalWrite(greenPin, LOW);  
  Serial.begin(115200);
}

void loop() {
  int touchValue = touchRead(touchPin);

  if (touchValue < 1000) {  
  }
}

void sequentialLEDs() {
  digitalWrite(redPin, HIGH);  
  delay(500);
  digitalWrite(redPin, LOW);  

  digitalWrite(bluePin, HIGH);  
  delay(500);
  digitalWrite(bluePin, LOW);  

  digitalWrite(greenPin, HIGH);
  delay(500);
  digitalWrite(greenPin, LOW);  
}

As a reminder, it will be used when the answer to the question asked by the user will be uploading, symbolised by the lights lighting up in a row.

We also looked for the materials that we don't have yet, such as the ball, the magnets, etc. Everything that isn't electronic.

Discussions