Main.ArduinoSamples History
Hide minor edits - Show changes to output
Changed lines 213-215 from:
*@@Led (1)@@ [Default pin: D_8]
to:
*@@Led (1)@@ [Default pin: D_8]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/simple_soft_button.thingml | Source code]]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/simple_soft_button.thingml | Source code]]
Added line 5:
[+Bricks based applications+]
Changed lines 15-17 from:
to:
[+Devices based applications+]
->[[#simple_soft_button | Simple soft button]]
->[[#simple_soft_button | Simple soft button]]
Changed lines 204-213 from:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_water_sensor.thingml | Source code]]
to:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_water_sensor.thingml | Source code]]
[[#simple_soft_button]]
!!Simple soft button
This is an example of use of soft button device. The LED turn in the opposite position when the button is simply pressed, blink fast after a double click and blink slow if a long press is detected.
'''Requirements'''
*@@Button (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
[[#simple_soft_button]]
!!Simple soft button
This is an example of use of soft button device. The LED turn in the opposite position when the button is simply pressed, blink fast after a double click and blink slow if a long press is detected.
'''Requirements'''
*@@Button (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
Changed lines 113-114 from:
*@@Lcd screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
to:
*@@Lcd screen 1602 (1)@@ [Default pins: D_10, D_11, D_12, D_13, A_0, A_1, A_2]
Changed line 136 from:
*@@Lcd screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
to:
*@@Lcd screen 1602 (1)@@ [Default pins: D_10, D_11, D_12, D_13, A_0, A_1, A_2]
Changed lines 1-2 from:
to:
!Sample applications
Changed lines 16-17 from:
to:
!!Simple button
Changed lines 40-41 from:
to:
!!Simple buzzer
Changed lines 60-61 from:
to:
!!Simple LED
Changed lines 80-81 from:
to:
!!Simple PWM
Changed lines 98-99 from:
to:
!!Simple screen
Changed lines 118-119 from:
to:
!!Simple sensor display
Changed lines 142-143 from:
to:
!!Simple sound sensor
Changed lines 161-162 from:
to:
!!Simple tilt switch
Changed line 180 from:
to:
!!Simple water sensor
Changed lines 5-13 from:
[[#simple_button | Simple button]]\\
[[#simple_buzzer | Simple buzzer]]\\
[[#simple_led | Simple led]]\\
[[#simple_pwm | Simple PWM]]\\
[[#simple_screen | Simple screen]]\\
[[#simple_sensor_display | Simple sensor display]]\\
[[#simple_sound | Simple sound sensor]]\\
[[#simple_tilt | Simple tilt]]\\
[[#simple_water | Simple water sensor]]
[[#simple_water | Simple water sensor]]
to:
->[[#simple_button | Simple button]]
->[[#simple_buzzer | Simple buzzer]]
->[[#simple_led | Simple led]]
->[[#simple_pwm | Simple PWM]]
->[[#simple_screen | Simple screen]]
->[[#simple_sensor_display | Simple sensor display]]
->[[#simple_sound | Simple sound sensor]]
->[[#simple_tilt | Simple tilt switch]]
->[[#simple_water | Simple water sensor]]
->[[#simple_buzzer | Simple buzzer]]
->[[#simple_led | Simple led]]
->[[#simple_pwm | Simple PWM]]
->[[#simple_screen | Simple screen]]
->[[#simple_sensor_display | Simple sensor display]]
->[[#simple_sound | Simple sound sensor]]
->[[#simple_tilt | Simple tilt switch]]
->[[#simple_water | Simple water sensor]]
Changed lines 5-15 from:
[[#simple_but]]
to:
[[#simple_button | Simple button]]\\
[[#simple_buzzer | Simple buzzer]]\\
[[#simple_led | Simple led]]\\
[[#simple_pwm | Simple PWM]]\\
[[#simple_screen | Simple screen]]\\
[[#simple_sensor_display | Simple sensor display]]\\
[[#simple_sound | Simple sound sensor]]\\
[[#simple_tilt | Simple tilt]]\\
[[#simple_water | Simple water sensor]]
[[#simple_button]]
[[#simple_buzzer | Simple buzzer]]\\
[[#simple_led | Simple led]]\\
[[#simple_pwm | Simple PWM]]\\
[[#simple_screen | Simple screen]]\\
[[#simple_sensor_display | Simple sensor display]]\\
[[#simple_sound | Simple sound sensor]]\\
[[#simple_tilt | Simple tilt]]\\
[[#simple_water | Simple water sensor]]
[[#simple_button]]
Changed line 39 from:
[[#simple_buz]]
to:
[[#simple_buzzer]]
Added line 5:
[[#simple_but]]
Added line 29:
[[#simple_buz]]
Added line 49:
[[#simple_led]]
Added line 69:
[[#simple_pwm]]
Changed lines 85-86 from:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_pwm.thingml | Source code]]
to:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_pwm_led.thingml | Source code]]
[[#simple_screen]]
[[#simple_screen]]
Added line 107:
[[#simple_sensor_display]]
Added line 131:
[[#simple_sound]]
Changed lines 150-151 from:
!!!Simple tilt
to:
[[#simple_tilt]]
!!!Simple tilt switch
!!!Simple tilt switch
Added line 169:
[[#simple_water]]
Added lines 81-82:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_pwm.thingml | Source code]]
Added lines 100-101:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_screen.thingml | Source code]]
Added lines 123-124:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_sensor_display.thingml | Source code]]
Added lines 141-142:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_sound_sensor.thingml | Source code]]
Added lines 159-160:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_tilt.thingml | Source code]]
Changed lines 180-182 from:
*@@Led (1)@@ [Default pin: D_8]
to:
*@@Led (1)@@ [Default pin: D_8]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_water_sensor.thingml | Source code]]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_water_sensor.thingml | Source code]]
Changed line 117 from:
*@@Sound@@ / @@Light@@ / @@Rotation@@ / @@Temperature sensor (1)@@ [Default pin: A_4]
to:
*(@@Sound@@ / @@Light@@ / @@Rotation@@ / @@Temperature) sensor (1)@@ [Default pin: A_4]
Added lines 85-94:
[@
state Run {
on entry do
LcdScreen!print_string ("Hello")
LcdScreen!set_cursor (0, 1)
LcdScreen!print_string ("World")
end
}
@]
state Run {
on entry do
LcdScreen!print_string ("Hello")
LcdScreen!set_cursor (0, 1)
LcdScreen!print_string ("World")
end
}
@]
Added lines 103-114:
[@
state Running {
on entry LcdScreen!set_cursor (0, 1)
transition refresh -> Running
event m : TempSensor?temperature_value
action do
LcdScreen!print_value (m.val)
LcdScreen!print_string (" ")
end
}
@]
state Running {
on entry LcdScreen!set_cursor (0, 1)
transition refresh -> Running
event m : TempSensor?temperature_value
action do
LcdScreen!print_value (m.val)
LcdScreen!print_string (" ")
end
}
@]
Added lines 123-130:
[@
state Running {
internal event m : SoundSensor?sound_value
guard m.val > threshold
action Led!led_toggle ()
}
@]
state Running {
internal event m : SoundSensor?sound_value
guard m.val > threshold
action Led!led_toggle ()
}
@]
Added lines 139-146:
[@
state Running
{
internal switch event TiltSwitch?tilt_toggle
action Led!led_toggle ()
}
@]
state Running
{
internal switch event TiltSwitch?tilt_toggle
action Led!led_toggle ()
}
@]
Added lines 154-166:
[@
state Idle {
transition wet -> LedOn
event m : WaterSensor?wet
action Led!led_on ()
}
state LedOn {
transition dry -> Idle
event m : WaterSensor?dry
action Led!led_off ()
}
@]
Changed lines 110-111 from:
to:
*@@Tilt switch (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
*@@Led (1)@@ [Default pin: D_8]
Changed lines 117-119 from:
'''Requirements'''
to:
'''Requirements'''
*@@Water sensor (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
*@@Water sensor (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
Changed lines 23-25 from:
*@@button (1)@@ [Default pin: D_9]
*@@led (1)@@ [Default pin: D_8]
*@@
to:
*@@Button (1)@@ [Default pin: D_9]
*@@Led (1)@@ [Default pin: D_8]
*@@Led (1)@@ [Default pin: D_8]
Changed lines 43-44 from:
*@@buzzer (1)@@ [Default pin: D_8]
to:
*@@Buzzer (1)@@ [Default pin: D_8]
Changed lines 62-63 from:
*@@led (1)@@ [Default pin: D_8]
to:
*@@Led (1)@@ [Default pin: D_8]
Changed line 78 from:
*@@led (1)@@ [Default pin: PWM_PIN_9]
to:
*@@Led (1)@@ [Default pin: PWM_PIN_9]
Changed lines 86-87 from:
*@@lcd_screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
to:
*@@Lcd screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
Changed lines 102-104 from:
to:
*@@Sound sensor (1)@@ [Default pin: A_4]
*@@Led (1)@@ [Default pin: D_8]
*@@Led (1)@@ [Default pin: D_8]
Added line 110:
Changed line 95 from:
*@@Sound sensor (1)@@ / @@Light Sensor (1)@@ / @@Rotation sensor (1)@@ / @@Temperature sensor (1)@@ [Default pin: A_4]
to:
*@@Sound@@ / @@Light@@ / @@Rotation@@ / @@Temperature sensor (1)@@ [Default pin: A_4]
Changed lines 86-87 from:
to:
*@@lcd_screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
Added lines 94-95:
*@@Lcd screen 1602 (1)@@ [Default pins: PIN_10, PIN_11, PIN_12, PIN_13, A_0, A_1, A_2]
*@@Sound sensor (1)@@ / @@Light Sensor (1)@@ / @@Rotation sensor (1)@@ / @@Temperature sensor (1)@@ [Default pin: A_4]
*@@Sound sensor (1)@@ / @@Light Sensor (1)@@ / @@Rotation sensor (1)@@ / @@Temperature sensor (1)@@ [Default pin: A_4]
Added lines 83-86:
The screen diplays "Hello World"
'''Requirements'''
'''Requirements'''
Added lines 89-93:
The screen displays the value of the sensor of your choice.
Keep in mind that in this application, you have to use only one sensor at the time.
'''Requirements'''
Keep in mind that in this application, you have to use only one sensor at the time.
'''Requirements'''
Added lines 96-99:
The led toggle when a high sound is detected.
'''Requirements'''
'''Requirements'''
Changed lines 102-110 from:
to:
The led toggle when the position of the tilt switch changes.
'''Requirements'''
!!!Simple water sensor
The led is on if the sensor detects water.
'''Requirements'''
'''Requirements'''
!!!Simple water sensor
The led is on if the sensor detects water.
'''Requirements'''
Changed lines 49-50 from:
The led simply blink (default frequency is one second). Frequency might be easily modified with the property @@simply_led.frequency@@.
to:
The led simply blink (default frequency is one second). Frequency might be easily modified with the property @@simply_led.frequency@@
Added lines 67-79:
The led intensity is controlled by the rotation sensor. Note this application is based on PWM core library and can be use to control other stuff than a LED.
[@
state Running {
internal event m : RotSensor?rotation_value
action Pwm!set_pwm_value (m.val / 4)
}
@]
'''Requirements'''
*@@led (1)@@ [Default pin: PWM_PIN_9]
*@@Rotation sensor (1)@@ -> [Default pin: A_4]
Changed lines 35-36 from:
on exit Timer!timer_start (50)
to:
on exit Timer!timer_start (50)
Added lines 49-60:
The led simply blink (default frequency is one second). Frequency might be easily modified with the property @@simply_led.frequency@@.
[@
state Running
{
on entry Timer!timer_start (frequency)
transition toggle -> Running
event Timer?timer_timeout
action Led!led_toggle ()
}
@]
[@
state Running
{
on entry Timer!timer_start (frequency)
transition toggle -> Running
event Timer?timer_timeout
action Led!led_toggle ()
}
@]
Added line 62:
*@@led (1)@@ [Default pin: D_8]
Added lines 9-21:
[@
state Idle {
transition pressed -> LedOn
event Button?press
action Led!led_on ()
}
state LedOn {
transition released -> Idle
event Button?release
action Led!led_off ()
}
@]
state Idle {
transition pressed -> LedOn
event Button?press
action Led!led_on ()
}
state LedOn {
transition released -> Idle
event Button?release
action Led!led_off ()
}
@]
Changed lines 30-31 from:
to:
The buzzer plays an SOS signal.
[@
state Wait {
on entry Timer!timer_start (1000)
on exit Timer!timer_start (50)
transition begin -> Fast
event Timer?timer_timeout
action end_motif = false
}
@]
'''Requirements'''
*@@buzzer (1)@@ [Default pin: D_8]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_buzzer.thingml | Source code]]
[@
state Wait {
on entry Timer!timer_start (1000)
on exit Timer!timer_start (50)
transition begin -> Fast
event Timer?timer_timeout
action end_motif = false
}
@]
'''Requirements'''
*@@buzzer (1)@@ [Default pin: D_8]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_buzzer.thingml | Source code]]
Changed lines 50-52 from:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_led.thingml | simple_led.thingml]]
to:
'''Requirements'''
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_led.thingml | Source code]]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_led.thingml | Source code]]
Changed lines 13-14 from:
to:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml | Source code]]
Changed lines 10-11 from:
*button (1) [Default pin: D_9]
*led (1) [Default pin: D_8]
*led (1) [Default pin: D_8]
to:
*@@button (1)@@ [Default pin: D_9]
*@@led (1)@@ [Default pin: D_8]
*@@led (1)@@ [Default pin: D_8]
Changed lines 10-11 from:
*@@button (1)@@ [Default pin: D_9]
*@@led (1)@@ [Default pin: D_8]
*
to:
*button (1) [Default pin: D_9]
*led (1) [Default pin: D_8]
*led (1) [Default pin: D_8]
Changed lines 10-11 from:
*@@button (1)@@ "Default pin: D_9"
*@@led (1)@@ "Default pin: D_8"
to:
*@@button (1)@@ [Default pin: D_9]
*@@led (1)@@ [Default pin: D_8]
*@@led (1)@@ [Default pin: D_8]
Changed lines 10-11 from:
*button (1) "Default pin: D_9"
*led (1) "Default pin: D_8"
*led (1) "Default pin: D_8"
to:
*@@button (1)@@ "Default pin: D_9"
*@@led (1)@@ "Default pin: D_8"
*@@led (1)@@ "Default pin: D_8"
Changed lines 1-2 from:
!Sample applications
to:
!!Sample applications
Changed lines 5-6 from:
!!Simple button
to:
!!!Simple button
The led is on while the button is pressed and off when it is released.
'''Requirements'''
*button (1) "Default pin: D_9"
*led (1) "Default pin: D_8"
The led is on while the button is pressed and off when it is released.
'''Requirements'''
*button (1) "Default pin: D_9"
*led (1) "Default pin: D_8"
Changed lines 15-16 from:
!!Simple buzzer
to:
!!!Simple buzzer
Changed lines 19-20 from:
!!Simple LED
to:
!!!Simple LED
Changed lines 23-33 from:
!!Simple PWM
!!Simple screen
!!Simple sensor display
!!Simple sound sensor
!!Simple tilt
!!Simple water sensor
!!Simple screen
!!Simple sensor display
!!Simple sound sensor
!!Simple tilt
!!Simple water sensor
to:
!!!Simple PWM
!!!Simple screen
!!!Simple sensor display
!!!Simple sound sensor
!!!Simple tilt
!!!Simple water sensor
!!!Simple screen
!!!Simple sensor display
!!!Simple sound sensor
!!!Simple tilt
!!!Simple water sensor
Changed lines 3-27 from:
to:
This page provides some simple applications directly based on electronic bricks library.
!!Simple button
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml | simple_button.thingml]]
!!Simple buzzer
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_buzzer.thingml | simple_buzzer.thingml]]
!!Simple LED
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_led.thingml | simple_led.thingml]]
!!Simple PWM
!!Simple screen
!!Simple sensor display
!!Simple sound sensor
!!Simple tilt
!!Simple water sensor
!!Simple button
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml | simple_button.thingml]]
!!Simple buzzer
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_buzzer.thingml | simple_buzzer.thingml]]
!!Simple LED
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_led.thingml | simple_led.thingml]]
!!Simple PWM
!!Simple screen
!!Simple sensor display
!!Simple sound sensor
!!Simple tilt
!!Simple water sensor
Changed line 3 from:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml]]
to:
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml | simple_button.thingml]]
Changed lines 1-3 from:
!Sample applications
to:
!Sample applications
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml]]
[[https://github.com/ffleurey/ThingML/blob/master/org.thingml.samples/src/main/thingml/arduino/apps/bricksamples/simple_button.thingml]]