Thursday, November 19, 2015

Processing Now Optimized for the Pi

Thanks to the new Hardware I/O libraries, Processing is now optimized for the Raspberry Pi. This makes it much easier to use the Raspberry Pi I/O pins, and send data back and forth with a Arduino.

Hardware I/O
The Hardware I/O library allows to access the computer's hardware peripherals, such as digital inputs and outputs, serial busses, and the like, in a fashion similar to the Arduino platform. This library is only available for embedded Linux boards with the necessary kernel drivers, such as the Raspberry Pi.

Considerations and limitations can be found at

New Processing / Raspberry Pi Tutorial -

boolean ledOn = false;

void setup() {
  GPIO.pinMode(4, GPIO.OUTPUT);

  // On the Raspberry Pi, GPIO 4 is pin 7 on the pin header,
  // located on the fourth row, above one of the ground pins
  // For this particular board one could also write:


void draw() {
  ledOn = !ledOn;
  if (ledOn) {
    GPIO.digitalWrite(4, GPIO.LOW);
  } else {
    GPIO.digitalWrite(4, GPIO.HIGH);
  ellipse(width/2, height/2, width*0.75, height*0.75);

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...