João Costa @JD557@blog.joaocosta.eu Follow

Portuguese software engineer at Kevel.

My instance is running on a small server so please #nobot

Web

https://www.joaocosta.eu/

GitHub

https://github.com/JD557

Twitter

https://twitter.com/JD557

Itch.io

https://jd557.itch.io

  • Notes
  • Articles 6
  • Followers 45
  • Following 59
João Costa's avatar
João Costa
@JD557@blog.joaocosta.eu

Got some Scala bindings for WiringPi thanks to SN-Bindgen (plus some manual adjustments)

https://gist.github.com/JD557/c81ad69f7506c70a5c26e9ddec24db27

Took me quite some time to get things to work... but at least I got a blinking LED today 😅 :

import wiringpi.all.*

println("Starting")
wiringPiSetup()

val led = 25

pinMode(led, OUTPUT)

while(true) {
  println("ON")
  digitalWrite(led, HIGH)
  Thread.sleep(1000)
  println("OFF")
  digitalWrite(led, LOW)
  Thread.sleep(1000)
}

I do need to figure out how to cross compile before I try something more complex... Scala Native compilation on a Raspberry Pi 3 B is SLOW! 😬

WiringPi bindings for Scala Gist
GIF
  • permalink
  • interact from your instance
  • 3 hours ago
  • 1 like
Likes
@kubukoz@mstdn.party
Powered by microblog.pub 2.0.0+dev (source code) and the ActivityPub protocol. Admin.