How do I add Code for a Project into the forum? In the normal Editor, special Characters are modified/Changed. How can I add a Code.ino for Arduino for a Project into my Forum?
Code tags are three ` before and after your block of code. On my English US keyboard its the key to the left of the 1 key with the ~ on it. It will retain indents etc.
Example code follows.
while True:
dateString = "%A %B %-d %-I:%M:%p"
msg = "It's %s" % (datetime.datetime.now().strftime(dateString))
sense.show_message(msg, scroll_speed=s, text_colour=(w, 255, 255))
t = sense.get_temperature()
t = round(t)
if t <= 0:
tc = [w, w, 255] # Blue
msg = "and it's a very Cold %sc" % (t)
elif t > 0 and t < 13:
tc = [255, 255, w] # Yellow
msg = "and it's a cool %sc" % (t)
elif t >= 13 and t < 25:
tc = [w, 255, w] # Green
msg = "and it's %sc" % (t)
elif t >= 25 and t < 30:
tc = [255, o, w] # Orange
msg = "and it's a Hot %sc" % (t)
elif t >= 30:
tc = [255, w, w] # Red
msg = "and it's a Very Hot %sc" % (t)
sense.show_message(msg, scroll_speed=s, text_colour=tc)