Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Funhouse setup for CIRCUIT PYHON
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Funhouse setup for CIRCUIT PYHON

by davidb21 on Mon Apr 19, 2021 1:50 pm

Hello,

I was trying to setup the Funhouse board and must have done something wrong so I went followed the process used for the MagTag setup involving the running the following command on my rpi400:

sudo esptool.py -p /dev/ttyACM0 write_flash 0x0 magtag_tinyuf2_combo.bin

After doing this I now see the circuit python drive when plugging the board but I am having trouble running the default sketch from https://github.com/adafruit/Adafruit_Ci ... /tag/1.1.2 .

Do I need to use the esptool w/ another tinyuf2 so the the fun house board IO mappings are correct?

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Mon Apr 19, 2021 2:11 pm

Also, I am using MU as described in this post (https://learn.adafruit.com/welcome-to-c ... n?view=all) but cannot get the REPL working.

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Mon Apr 19, 2021 2:37 pm

I think I bricked the funhouse board. I don't see the bin file located at https://github.com/adafruit/uf2-samdx1/ ... ag/v3.13.0, can it be posted?

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by DavidDyck on Mon Apr 19, 2021 11:53 pm

davidb21 wrote:Also, I am using MU as described in this post (https://learn.adafruit.com/welcome-to-c ... n?view=all) but cannot get the REPL working.


Hi davidb21, after receiving some advice on discord, I was able to get the bin file installed, and Mu editor to connect to the serial REPL !

DavidDyck
 
Posts: 11
Joined: Tue Oct 13, 2020 11:38 am

Re: Funhouse setup for CIRCUIT PYHON

by DavidDyck on Mon Apr 19, 2021 11:56 pm

davidb21 wrote:I think I bricked the funhouse board. I don't see the bin file located at https://github.com/adafruit/uf2-samdx1/ ... ag/v3.13.0, can it be posted?


I was able to install the bin file from the S3 folder of https://circuitpython.org/board/adafruit_funhouse/

from discord I learned that I needed to do erase_flash command from esptool before the usual write_flash

DavidDyck
 
Posts: 11
Joined: Tue Oct 13, 2020 11:38 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 8:32 am

I was able to get the REPL as indicated above by running the erase and then flash using these commands:

sudo esptool.py -p /dev/ttyACM0 erase_flash
sudo esptool.py -p /dev/ttyACM0 write_flash 0x0 funhouse.bin

Thanks!

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 9:01 am

Does the funhouse and magtag boards come from the factory w/ circuit python?

In order to get the REPL on these boards active I have had to use the esptool to flash them which I don't mind doing, but just wanted clarification if I am doing something wrong.

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by DavidDyck on Tue Apr 20, 2021 1:10 pm

davidb21 wrote:Does the funhouse and magtag boards come from the factory w/ circuit python?


The Funhouse did not come with circuit python installed. ( assuming it was an arduino sketch )

DavidDyck
 
Posts: 11
Joined: Tue Oct 13, 2020 11:38 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 3:11 pm

Is there a place I can download the modules to get the default example working, I am getting this:

Traceback (most recent call last):
File "code.py", line 7, in <module>
File "adafruit_dps310.py", line 34, in <module>
ImportError: no module named 'adafruit_register'

Thanks.

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 3:12 pm

For reference, here is the code.py:

# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
import board
from digitalio import DigitalInOut, Direction, Pull
import adafruit_dps310
import adafruit_ahtx0
from adafruit_funhouse import FunHouse

funhouse = FunHouse(
default_bg=0x0F0F00,
scale=2,
)

i2c = board.I2C()
dps310 = adafruit_dps310.DPS310(i2c)
aht20 = adafruit_ahtx0.AHTx0(i2c)

funhouse.peripherals.set_dotstars(0x800000, 0x808000, 0x008000, 0x000080, 0x800080)

# sensor setup
sensors = []
for p in (board.A0, board.A1, board.A2):
sensor = DigitalInOut(p)
sensor.direction = Direction.INPUT
sensor.pull = Pull.DOWN
sensors.append(sensor)


def set_label_color(conditional, index, on_color):
if conditional:
funhouse.set_text_color(on_color, index)
else:
funhouse.set_text_color(0x606060, index)


# Create the labels
funhouse.display.show(None)
slider_label = funhouse.add_text(
text="Slider:", text_position=(50, 30), text_color=0x606060
)
capright_label = funhouse.add_text(
text="Touch", text_position=(85, 10), text_color=0x606060
)
pir_label = funhouse.add_text(text="PIR", text_position=(60, 10), text_color=0x606060)
capleft_label = funhouse.add_text(
text="Touch", text_position=(25, 10), text_color=0x606060
)
onoff_label = funhouse.add_text(text="OFF", text_position=(10, 25), text_color=0x606060)
up_label = funhouse.add_text(text="UP", text_position=(10, 10), text_color=0x606060)
sel_label = funhouse.add_text(text="SEL", text_position=(10, 60), text_color=0x606060)
down_label = funhouse.add_text(
text="DOWN", text_position=(10, 100), text_color=0x606060
)
jst1_label = funhouse.add_text(
text="SENSOR 1", text_position=(40, 80), text_color=0x606060
)
jst2_label = funhouse.add_text(
text="SENSOR 2", text_position=(40, 95), text_color=0x606060
)
jst3_label = funhouse.add_text(
text="SENSOR 3", text_position=(40, 110), text_color=0x606060
)
temp_label = funhouse.add_text(
text="Temp:", text_position=(50, 45), text_color=0xFF00FF
)
pres_label = funhouse.add_text(
text="Pres:", text_position=(50, 60), text_color=0xFF00FF
)
funhouse.display.show(funhouse.splash)

while True:
funhouse.set_text("Temp %0.1F" % dps310.temperature, temp_label)
funhouse.set_text("Pres %d" % dps310.pressure, pres_label)

print(aht20.temperature, aht20.relative_humidity)
set_label_color(funhouse.peripherals.captouch6, onoff_label, 0x00FF00)
set_label_color(funhouse.peripherals.captouch7, capleft_label, 0x00FF00)
set_label_color(funhouse.peripherals.captouch8, capright_label, 0x00FF00)

slider = funhouse.peripherals.slider
if slider is not None:
funhouse.peripherals.dotstars.brightness = slider
funhouse.set_text("Slider: %1.1f" % slider, slider_label)
set_label_color(slider is not None, slider_label, 0xFFFF00)

set_label_color(funhouse.peripherals.button_up, up_label, 0xFF0000)
set_label_color(funhouse.peripherals.button_sel, sel_label, 0xFFFF00)
set_label_color(funhouse.peripherals.button_down, down_label, 0x00FF00)

set_label_color(funhouse.peripherals.pir_sensor, pir_label, 0xFF0000)
set_label_color(sensors[0].value, jst1_label, 0xFFFFFF)
set_label_color(sensors[1].value, jst2_label, 0xFFFFFF)
set_label_color(sensors[2].value, jst3_label, 0xFFFFFF)

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 5:22 pm

I found the libs located here: https://circuitpython.org/libraries

I've been trying to install them one at a time but just keep find more modules I need to install.

Is there a FunHouse git repo that has all the library files needed to run example code?

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 5:48 pm

I think I found the require libs:

# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT

Adafruit-Blinka
adafruit-blinka-displayio
adafruit-circuitpython-portalbase
adafruit-circuitpython-dotstar
adafruit-circuitpython-requests
adafruit-circuitpython-simpleio
adafruit-circuitpython-minimqtt

Need a download link.

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Tue Apr 20, 2021 6:35 pm

So I found the blinka source code, but will this work if I just drop it on the funhouse lib directory or does it need to live on the same directory as the code.py / main.py?

https://github.com/adafruit/Adafruit_Bl ... er/esp8266

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Wed Apr 21, 2021 8:16 am

Also, is the demo *.ino code to load into Arduino available?

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse setup for CIRCUIT PYHON

by davidb21 on Wed Apr 21, 2021 2:27 pm

I am following the new FunHouse guide published today, but I get the following error:

Traceback (most recent call last):
File "code.py", line 7, in <module>
File "adafruit_dps310.py", line 34, in <module>
ImportError: no module named 'adafruit_register'

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

davidb21
 
Posts: 28
Joined: Mon Mar 24, 2014 9:13 am

Please be positive and constructive with your questions and comments.