Sha256: b5ef5e3c7dad07ca8413ab321570fc06a8da2ad59defbd15a39e52199d66c2ab

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

---
layout: post
title:  "Getting Started"
date:   2018-05-24 07:34:13
categories: PiCrate update
permalink: /getting/
---
The current version of raspbian installs jdk-1.8.0_65-bi17 (hard float) and that is just fine, if you have more that one version of java installed you could use `update-alternatives` tool to control them.

Then install JRuby see [jruby][jruby].



```bash
jgem install picrate
```

Install samples

```bash
picrate -i Samples
```

Install processing libraries

```bash
picrate -i Sound
picrate -i glvideo # preferred over vanilla video for now
```

Create template

```bash
picrate -c my_sketch 600 400
```
creates file my_sketch.rb

```ruby
#!/usr/bin/env jruby
# frozen_string_literal: false
require 'picrate'

class MySketch < Processing::App
  def settings
    size 200, 200
  end

  def setup
    sketch_title 'My Sketch'
  end

  def draw

  end
end
MySketch.new

```

Edit in say vim
```bash
vim my_sketch.rb
:!jruby % # from vim runs the sketch
```

Alternatively to run sketches

```bash
jruby my_sketch.rb
```

Or even `chmod +x my_sketch.rb` to make an executable script.

### Circle Collision Sketch Running on RaspberryPI

![circle_collisions]({{ site.github.url }}/assets/circle_collisions.png)

[jruby]:{{ site.github.url }}/install_jruby/

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picrate-0.5.0-java docs/_posts/2018-05-06-getting_started.md
picrate-0.4.3-java docs/_posts/2018-05-06-getting_started.md
picrate-0.4.2-java docs/_posts/2018-05-06-getting_started.md