summaryrefslogtreecommitdiff
path: root/julia-arduino-master/examples/LDR/ldr-led.jl
blob: 6957ce292fc5ef33ea8c917bdcf1298df432898d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
using SerialPorts
using ArduinoTools

ser = connectBoard(115200)
pinMode(ser,9,"OUTPUT")
for i = 1:500
  p = analogRead(ser,5)
  println(p)
  if p > 300  digiWrite(ser,9,0)
  else digiWrite(ser,9,1) end
end
close(ser)