Seonghee Kim | |
13. Interface and Application Programming | |
HOME | ABOUT | ASSIGNMENTS | FINAL PROJECT| CONTACT | |
Week13
Assignments
-group assignment
compare as many tool options as possible-individual assignment
write an application that interfaces with an input &/or output device that you madeHardware and Softwares used
-arduino IDE
-Processing
-Python
Outcome
Studied processing and python. Designing GUI and coding input board to work.
Processing
download and install processing
Since I only have a basic knowledge on programming, I decided to make GUI with processing. Processing is very similar with arduino because arduino originally based on processing.-Download and install Processing here
Basic command for processing
setup()
-The setup function run once when the program starts like arduino setup().
draw()
-the draw function continuously executes until the program is stopped like arduino loop().
print()
-the print function writes to the console area, the black rectangle at the bottom.
size()
-the window size width and height in units of pixels. the size() function must be the first line of code inside setup.
background()
-set background color of the window.
fill()
-fill the color of the shape.
stroke()
-draw borders of the shape.
rect()
- Draws a rectangle.
ellipse()
- Draws an circle, oval.
-more referances for command.
Processing and Arduino
-click here to know how to connent processing with arduino.First, I tested to arduino. I coded when mouse clicked, led turns on and off and the window color changes black and whitein in order.
-Click here to download files(arduino_proce.pde, arduion_processing.ino)
Processing Utrasonic Sensor
- I have to change above 2 lines. Erase mySerial.println("cm"); because I only needed distance value for porcessing code. and changed print to println to send '/n' to processing code.
-Click here to download files(distance_seong.pde, fab_distance.ino)
-
Python
-Download and setup phthon 2.7 (I downloaded 2.7, not 3.6)
-download the pyserial and setup.
-type 'python setup.py install'
-type ' python -m pip install -U pit setuptools' to install setuptools.
-type 'python -m pip install -U pip setuptools' to set up pip
-type 'python -m serial.tools.list_ports' to see my port.
-I can see com1(before I had to check if FTDI USB serial converter is ok.
-type 'python -m serial.tools.miniterm' to see if data comes.
-enter '2' to see datas comming in by com3 port.
-I had to embed the program with cfile to use python.
-to see how to upload .c file, click here to see week 9 assignment.
Date: 2018-04-24 Author: Seong Hee Kim @ Fablab Seoul