<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Python Code: AHS by job goh</title>
      <link>https://padlet.com/job_goh_ts/ahs_python1</link>
      <description>Check your code here</description>
      <language>en-us</language>
      <pubDate>2021-10-21 15:14:47 UTC</pubDate>
      <lastBuildDate>2021-10-27 01:23:08 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f4bb.png</url>
      </image>
      <item>
         <title>Lesson 2 : Rainbow</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1835220995</link>
         <description><![CDATA[<div>import event, halo, time</div><div><br></div><div>@event.start</div><div>def on_start():</div><div>&nbsp; &nbsp; while True:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.motion_sensor.is_tilted_left():</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left_rainbow()</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.motion_sensor.is_tilted_right():</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; right_rainbow()</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.motion_sensor.is_arrow_up():</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up_rainbow()</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.motion_sensor.is_arrow_down():</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; down_rainbow()</div><div><br></div><div>def left_rainbow ():</div><div>&nbsp; &nbsp; halo.led.show_ring('black black black black black purple blue cyan green yellow orange red')</div><div><br></div><div>def right_rainbow ():</div><div>&nbsp; &nbsp; halo.led.show_ring('orange yellow green cyan blue purple black black black black black red')</div><div><br></div><div>def up_rainbow ():</div><div>&nbsp; &nbsp; halo.led.show_ring('black black blue green orange red yellow cyan purple black black black')</div><div><br></div><div>def down_rainbow ():</div><div>&nbsp; &nbsp; halo.led.show_ring('orange green blue black black black black black purple cyan yellow red')</div><div><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-22 02:20:38 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1835220995</guid>
      </item>
      <item>
         <title>https://ide.mblock.cc/</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1835260535</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://ide.mblock.cc/" />
         <pubDate>2021-10-22 02:38:47 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1835260535</guid>
      </item>
      <item>
         <title>Lesson 3:  Tilt Smile</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1838614254</link>
         <description><![CDATA[<div>import event, halo, time</div><div><br></div><div>@event start</div><div>def on_start():</div><div>&nbsp; &nbsp; while True:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.motion_sensor.get_pitch() &gt; 70:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_ring('yellow black black yellow yellow yellow yellow yellow black black yellow black')</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.off_all()</div><div><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 01:32:53 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1838614254</guid>
      </item>
      <item>
         <title>Lesson 3:  Jump counter</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1838615174</link>
         <description><![CDATA[<div>import event, halo, time</div><div>jump_count = 0</div><div><br></div><div>@event.start</div><div>def on_start():</div><div>&nbsp; &nbsp; global jump_count</div><div>&nbsp; &nbsp; jump_count = 0</div><div>&nbsp; &nbsp; while True:&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while not halo.motion_sensor.is_shaked():</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pass</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; jump_count = jump_count + 1</div><div>&nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_single(jump_count, 255, 0, 0)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; time.sleep(1)</div><div><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 01:34:29 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1838615174</guid>
      </item>
      <item>
         <title>Lesson 3: Buzzer</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1838619359</link>
         <description><![CDATA[<div>halo.pin0.play_tone(700,1)<br><br>____<br><br>halo.pin0&nbsp; = pin 0 is connected. You can change to pin 1, 2, or 3 as well.<br><br>(700,1) &nbsp; = the first number represents the frequency at which the sound is played.<br><br>&nbsp;The second number represents how many seconds the sound is played for.</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 01:41:57 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1838619359</guid>
      </item>
      <item>
         <title>Lesson 4: Servo Motor control</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1838621425</link>
         <description><![CDATA[<div>import event, halo, time</div><div>jump_count = 0</div><div><br></div><div>@event.start</div><div>def on_start():</div><div>&nbsp; &nbsp; while True:&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.touchpad1.is_touched()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.pin0.servo_write(0)</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.touchpad2.is_touched()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.pin0.servo_write(180)</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 01:45:30 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1838621425</guid>
      </item>
      <item>
         <title>Lesson 4: WiperSpeed</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1838626197</link>
         <description><![CDATA[<div>import event, halo, time</div><div>#initialize variables #this is a comment, and doesn't affect the code</div><div>WiperSpeed = 0</div><div><br></div><div>@event.start</div><div>def on_start():</div><div>&nbsp; &nbsp; global WiperSpeed</div><div>&nbsp; &nbsp; WiperSpeed = 2</div><div>&nbsp; &nbsp; while True:&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if WiperSpeed == 0:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WiperSpeed = 2</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; halo.pin0.servo_write(0)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; time.sleep(float(WiperSpeed))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; halo.pin0.servo_write(180)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; time.sleep(float(WiperSpeed))</div><div><br></div><div>@event.button_pressed</div><div>def on_button_pressed():</div><div>&nbsp; &nbsp; global WiperSpeed</div><div>&nbsp; &nbsp; WiperSpeed = WiperSpeed - 0.5</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 01:53:42 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1838626197</guid>
      </item>
      <item>
         <title>Lesson 5: Moisture Detector</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1839335698</link>
         <description><![CDATA[<div>import event, halo, time&nbsp;</div><div><br></div><div>@event.button_pressed</div><div>def on_button_pressed():</div><div>&nbsp; &nbsp; halo.led.off_all()</div><div>&nbsp; &nbsp; while halo.pin2.read_analog() &gt; 0:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; print(halo.pin2.read_analog()) #this is to print/show the moisture level</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.pin2.read_analog() &lt; 974:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_single(7, 255, 0, 0)</div><div>#include the rest of the code for the different moisture levels here</div><div>&nbsp; &nbsp; &nbsp; &nbsp; else halo.led.off_all()</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 14:24:46 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1839335698</guid>
      </item>
      <item>
         <title>Lesson 5: Proximity Sensor</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1839348010</link>
         <description><![CDATA[<div>import event, halo, time&nbsp;</div><div><br></div><div>@event.button_pressed</div><div>def on_button_pressed():</div><div>&nbsp; &nbsp; halo.led.off_all()</div><div>&nbsp; &nbsp; while True&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if halo.pin2.read_digital() == 0:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for count in range(1):&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_ring('red red white white white red red red white white white red')</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_ring('red red white white white red red red white white white red',3)</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-24 14:32:00 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1839348010</guid>
      </item>
      <item>
         <title>Project Brief</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1843503441</link>
         <description><![CDATA[<div>You'll need to code the Halocode to respond to an input and respond with an output.<br><br>E.g detection of infrared sensor (detects movements) - causes Halocode to light up.<br><br>You can theme your project program around 3 themes as guidelines, convenience, security, efficiency.<br><br>E.g Convenience = The Halocode works as an automatic plant watering system.&nbsp;<br><br>The halocode is connected to a moisture sensor, which sends data about moisture levels to the halocode.&nbsp;<br><br>Below a certain moisture level, the halocode will turn the servo motor(which is connected to the watering can to tilt it, to water plants).<br><br>Security; The Halocode uses the IR sensor to detect incoming/objects close to the sensor and starts flashing red lights as a warning.<br>---<br><br>Remember that you can change your outputs and use the various lines of code to adjust the output you want.<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-26 01:41:56 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1843503441</guid>
      </item>
      <item>
         <title>How to connect the wires????</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1843701968</link>
         <description><![CDATA[<div>For Moisture sensor<br><br>Moisture sensor - connector - connector - halocode<br>VCC to 3.3v<br>GND to GND<br>AO to Any Number Pin<br><br><br>Infrared Sensor - Halocode<br>VCC - 3.3v<br>GND - GND<br>OUT - Any numbered pin<br><br>SERVO MOTOR<br><br>RED WIRE - 3.3V<br>ORANGE WIRE - Any numbered pin<br>BROWN WIRE - GND<br><br><br>BUZZER<br><br>Long Pin on buzzer - any numbered pin<br>Short Pin on buzzer - GND</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-26 03:00:34 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1843701968</guid>
      </item>
      <item>
         <title>Bad Code!!</title>
         <author>job_goh_ts</author>
         <link>https://padlet.com/job_goh_ts/ahs_python1/wish/1846714450</link>
         <description><![CDATA[<div>Please check for my code errors:<br><br>&nbsp; &nbsp; import event, halo, time</div><div>&nbsp; &nbsp; count=0</div><div>&nbsp; &nbsp; @event start</div><div>&nbsp; &nbsp; def_onstart</div><div>&nbsp; &nbsp; &nbsp; &nbsp; global_count</div><div>&nbsp; &nbsp; &nbsp; &nbsp; count=0</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while true</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count=count+1</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; halo.led.show_single(count,255,255,255)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time_sleep[1]</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-27 01:16:09 UTC</pubDate>
         <guid>https://padlet.com/job_goh_ts/ahs_python1/wish/1846714450</guid>
      </item>
   </channel>
</rss>
