Twitter en lumière
Sommaire
-
Introduction
-
Les bases du code
-
Allumons la lumière
-
Un peu de logique
-
Connexion avec Twitter
#GroupeLaPoste
#LaPoste
Raspberry Pi
Micro-ordinateur
- HDMI
- USB
- Ethernet
- MicroSD
- GPIO
- 700 Mhz
- 512 Mo
Ruby
irb
puts("Bonjour Marie")
name = "Yassin"
puts("Bonjour " + name)
name = "Simplon"
puts("Bonjour " + name)
name.upcase()
Led.yellow()
load "led.rb"
Led.red()
Led.blue()
Led.pink()
Led.green()
Led.yellow()
Led.orange()
?
Bonjour
Hello
country = "France"
if country.include("France")
puts("Bonjour")
end
country = "England"
if country.include("France")
puts("Bonjour")
else
puts("Hello")
end
countries = ["France", "Mali", "Sénégal"]
country = "Mali"
if country.include(countries)
puts("Bonjour")
end
Twitter.when(["#LaPoste"]) do |tweet|
puts(tweet)
end
Twitter.when(["#LaPoste", "#GroupeLaPoste"]) do |tweet|
puts(tweet)
if tweet.include(["#GroupeLaPoste"])
Led.blue()
end
end
Twitter.when(["#LaPoste", "#GroupeLaPoste"]) do |tweet|
puts(tweet)
if tweet.include(["#GroupeLaPoste"])
Led.blue()
else
Led.yellow()
end
end
Twitter.when(["#LaPoste", "#GroupeLaPoste"]) do |tweet|
puts(tweet)
if tweet.include(["merci", "super", "bravo"])
Led.green()
elsif tweet.include(["#GroupeLaPoste"])
Led.blue()
else tweet.include(["#LaPoste"])
Led.yellow()
end
end
load "sms.rb"
Twitter.when(["#GroupeLaPoste", "#LaPoste"]) do |tweet|
puts(tweet)
if tweet.include(["#GroupeLaPoste"])
Led.blue()
Sms.send("+33650174288", tweet)
else
Led.yellow()
end
end
Merci
Twitter en lumière (LaPoste)
By aghaniyassin
Twitter en lumière (LaPoste)
- 1,062