Week19 - Project Development

Answer

complete your final project, tracking your progress:

what tasks have been completed, and what tasks remain?

I have finished the ID design,painting,3D printer,Soldering and Programme
I'm still working on Wifi connection.

what has worked? what hasn’t?

Most of functions has worked,but I still working on Wifi connection

what questions need to be resolved?

The ID is too bad,I need to find someone to desgin a new model.

what will happen when?

June 5~6th - Electronic design

Draw the Schematic

Layout the PCB Board

Output to Roland machine and mill the board

Soldering the board and connect with wire

June 7~10th - Electronic test and programm

1
#include <Servo.h>
#include <Ultrasonic.h>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

//==============NeoPixels=============
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            6

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      24

#define BRIGHTNESS 5

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second

int ledPoint = 0;



//===========================


Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0;    // variable to store the servo position

Ultrasonic ultrasonic(9,8); // (Trig PIN,Echo PIN)
int distance;

void setup() {
  myservo.attach(10);  // attaches the servo on pin 9 to the servo object
  Serial.begin(9600);

  pixels.begin(); // This initializes the NeoPixel library.
  pixels.setBrightness(BRIGHTNESS);
  pinMode(13,OUTPUT);
}

void loop() {
  distance = ultrasonic.Ranging(CM);
  Serial.print(distance); // CM or INC
  Serial.println(" cm" );
  if(distance<50){
    distance = ultrasonic.Ranging(CM);
    if(distance<50){
      if(ledPoint<=24){
        ledPoint++;
        pixels.setPixelColor(ledPoint,255, 255, 255);
      }else{
        ledPoint = 0;
        sweepOut();
        pixels.clear();
      }
    }
  }else{
    if(ledPoint>0){
      pixels.setPixelColor(ledPoint,0, 0, 0);
      ledPoint--;
    }else{
      ledPoint = -1;
      pixels.clear();
    }
  }
  Serial.print("LedPoint: ");
  Serial.println(ledPoint);
  pixels.show();
  delay(50);
}

void sweepOut(){
  digitalWrite(13,HIGH);
  myservo.write(30);
  delay(500);
  myservo.write(180);
  delay(1000);
  digitalWrite(13,LOW);


}

//no use now
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<pixels.numPixels(); i++) {
    pixels.setPixelColor(i, c);
    pixels.show();
    delay(wait);
  }
}

June 11~18th - Struct design and test

Design process

StructRecord

Struct test

June 19~20 - assembling

June19~21th - Finial testing and debugging

what have you learned?

Before I join the fabacademy,I just know how to programm and design PCB board.
But now, I can design 2D and 3D files,and make it real,but there is still a long way for me to make almost anything.


This work is licensed under a Creative Commons Attribution 4.0 International License.

文章目录
  1. 1. Answer
    1. 1.1. what tasks have been completed, and what tasks remain?
    2. 1.2. what has worked? what hasn’t?
    3. 1.3. what questions need to be resolved?
    4. 1.4. what will happen when?
      1. 1.4.1. June 5~6th - Electronic design
      2. 1.4.2. June 7~10th - Electronic test and programm
      3. 1.4.3. June 11~18th - Struct design and test
        1. 1.4.3.1. Design process
        2. 1.4.3.2. Struct test
      4. 1.4.4. June 19~20 - assembling
      5. 1.4.5. June19~21th - Finial testing and debugging
    5. 1.5. what have you learned?
,