User Tools

Site Tools


granular_gripper

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
granular_gripper [2019/07/29 15:57]
yuhanghe [Circuit]
granular_gripper [2019/07/29 16:22]
yuhanghe [Final Words]
Line 118: Line 118:
 ==== Programming ==== ==== Programming ====
  
-A link to the source code can be found <provide URL to your code, probably saved in this DASL Wiki>.+A link to the source code can be found {{:​yuhang:​gripper:​vacuum_control1.zip| Arduino Code}}
 \\ \\
-The goal of the code is <brief explanation>​.  ​It works in the following way +<code cpp | Switch.ino> 
-\\ +  String input; // for incoming serial data 
----- +  int command; 
-<!- Insert ​snippet ​of your code here.  Try to keep to less than 0.5 page long --> +  bool vac = false; //Switch condition for vacuum 
----- +  bool blow = false; //Switch condition for blow off 
-\\ +  bool off = true; //Switch condition for off 
-The snippet above serves to <fill in the blank>It does this by <fill in the blank>+   
-\\ +void setup() { 
----- +  Serial.begin(9600);​ // opens serial port, sets data rate to 9600 bps 
-<!- Insert another snippet of your code here ​Try ​to keep to less than 0.5 page long --> +  pinMode(8, OUTPUT); //Assign port 8 and 9 as digital output 
----- +  pinMode(9, OUTPUT); 
-Nextthe code does <fill in the blank>.  ​It does this by <fill in the blank>  +  digitalWrite(9,​ HIGH); 
-<!-- Keep entering snippets of code and descriptions until you've given enough ​for a reader to understand how it works -->+  digitalWrite(8,​ HIGH); 
 +
 + 
 +void loop() { 
 +  // send data only when you receive data: 
 +  if (Serial.available() > 0) { 
 +    // read the incoming string: 
 +    input = Serial.readString();​ 
 +    // read input data from the serial monitor 
 +    ​command = input.toInt();​ 
 +    // enter a command of 1 to turn on and off vac 
 +      if (command == 1) { 
 +        vac = !vac; 
 +      } 
 +    // enter command ​of to turn on and off blow off 
 +      if (command == 3) { 
 +        blow = !blow; 
 +      } 
 +      /*Serial.print("​vac:​ "); 
 +      ​Serial.println(vac);​ 
 +      ​Serial.print("​blow:​ "); 
 +      ​Serial.println(blow);​ 
 +      Serial.print("​off:​ "); 
 +      ​Serial.println(off);​*/​ 
 +         
 +    if (vac && blow || !vac && !blow) { 
 +      vac = false; 
 +      blow = false; 
 +      Serial.println("​off"​);​ 
 +      // due to circuit design, a HIGH digital output corresponds ​to off for the ejector signal 
 +      digitalWrite(9,​ HIGH); 
 +      digitalWrite(8,​ HIGH); 
 +    } 
 +    else if (blow) { 
 +      Serial.println("​blow on"); 
 +      // digital pin 8 is connected to blow off 
 +      ​digitalWrite(8LOW); 
 +      digitalWrite(9,​ HIGH); 
 +      delay(300);​ 
 +      digitalWrite(8,​ HIGH); 
 +      blow = false; 
 +      vac = false; 
 +      Serial.println("​off"​);​ 
 +    } 
 +    else if (vac) { 
 +      Serial.println("​vacuum on"​);​ 
 +      // digital pin 9 is connected to vacuum 
 +      digitalWrite(9,​ LOW); 
 +      digitalWrite(8,​ HIGH); 
 +    } 
 +  
 +
 +</code> 
 +The command for the ejector controller is entered through Serial Monitor on the Arduino IDE accessed through the Tools menu on the top of IDE. 
 +Enter 1 in the command line to turn on vacuum
 +{{ :​yuhang:​gripper:​vacuum_on.png |}} 
 +Enter 3 in the command line for a short blow off. 
 +{{ :​yuhang:​gripper:​blow_off.png |}}
 // //
 // //
 ==== Final Words ==== ==== Final Words ====
  
-This tutorial'​s objective was to <fill in the blank>. Complete <choose: construction details, source code and program descriptions>​ for <fill in the blank>. Once the concepts were conveyed the reader could <fill in the blank>​. +This tutorial'​s objective was to demonstrate ​the process ​of building ​the granular gripper
-\\ +
-\\ +
-Speculating future work derived from this tutorial, includes <fill in the blank>. In the big picture, the problem ​of <fill in the blank> can be solved with this tutorial.+
 \\ \\
 \\ \\
-For questions, clarifications,​ etc, Email: <paul.oh@unlv.edu>​+For questions, clarifications,​ etc, Email: <hey6@unlv.nevada.edu>
  
  
granular_gripper.txt · Last modified: 2019/07/29 16:22 by yuhanghe