Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.serial.*;
- Serial port;
- int[]bjval;
- void setup()
- {
- println(Serial.list());
- port = new Serial(this, Serial.list() [0], 9600);
- }
- void draw()
- {
- if(keyPressed)
- {
- if (key == 'w' || key == 'W') {
- port.write('W');
- }
- if (key == 's' || key == 'S') {
- port.write('S');
- }
- if (key == 'a' || key == 'A') {
- port.write('A');
- }
- if (key == 'd' || key == 'D') {
- port.write('D');
- }
- if (key == 'k' || key == 'K') {
- port.write('K');
- }
- if (key == 'i' || key == 'I') {
- port.write('I');
- }
- if (key == 'j' || key == 'J') {
- port.write('J');
- }
- if (key == 'l' || key == 'L') {
- port.write('L');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement