5-1 Assembler, C ------ Native Coding Hello.ftdi + LED + Button + Processing (Serial Library)
Source Codes (Both PC-side and Microconttoller-side) are at the bottom of this page.
FabISP
Hello.ftdi Board
Eagle Design.
LED Output PIN5 (PB2)
Button Input PIN10 (PA3)
Design
Outline and Holes
Wires
5-2 Modella Milling!!! with lots of failures
Failure-1: When I used a 1/8, 1/16, 1/32 endmills, it was too thick.....
Failure-2: When the surface was not flat, the result was...
Useless.
Failure3: Jie kindly taught me how to make a circuit by a vinyl-cutter.
Thank you very much! It was fun!
However, because of my bad skills of craft, it became messy....
Failure4: Two lines were not separated......Be careful.
Don't believe Modella, because he is a machine!
Failure5: It took so many hours and days to debug..... Thank you multimeter..
5-3 Result: "Motivation Recoverer" for making almost anything.
(My laptop computer was broken last week. I was almost despared. I really had to recover my motivation. )
5-4: Code (PC)
Processing Code:
import fullscreen.*;
FullScreen fs;
import processing.serial.*;
Serial myPort;
PFont fontA;
void setup() {
size(800, 800);
println(Serial.list());
myPort = new Serial(this, Serial.list()[2], 9600);
fs = new FullScreen(this);
fs.setShortcutsEnabled(true);
}
void draw(){
String inByte = myPort.readString();
if (inByte!=null) { fill(255); text("You can make almost anything!!!", 160, 400);}
if (inByte==null) { background(0);}
}
#define output(directions,pin) (directions |= pin) // set port direction for output
#define set(port,pin) (port |= pin) // set port pin
#define clear(port,pin) (port &= (~pin)) // clear port pin
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set
#define bit_delay_time 8.5 // bit delay for 115200 with overhead
#define bit_delay() _delay_us(bit_delay_time) // RS232 bit delay
#define half_bit_delay() _delay_us(bit_delay_time/2) // RS232 half bit delay
#define char_delay() _delay_ms(10) // char delay