Hello
I am a happy owner of a Circuit playground express.
I am a newbie in programming, and I have tried to write a program.
It runs fine, but when I use KeyboardInterrupt (ctrl + c) in putty ssh terminal, I got some strange respond.
I have the lastest firmware file (uf2 version 2.0) and the lastest circuitpython bundle with library.
This can be seen on the pictures.
I hope someone can help me (:
Circuit playground express code
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Circuit playground express code
- Attachments
-
- code putty.png (66.49 KiB) Viewed 591 times
-
- code circuitplayground express.png (89.77 KiB) Viewed 591 times
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
As an addition.
The code works when the board is connected to a laptop, but not with batterypack.
The code works when the board is connected to a laptop, but not with batterypack.
- danhalbert
- Posts: 4652
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Circuit playground express code
Glad you're having fun! The "Traceback" you are seeing when you type control-C is completely expected. You have interrupted the program and it tells you where the interrupt happened.
A simplication of your if statement:
You don't explicitly have to compare with True, and if it's not True, then it's going to be False.
There's nothing wrong with your code that would make it not work with a battery pack. I'd suspect an issue with the pack: it may simply need to be charged more.
A simplication of your if statement:
Code: Select all
while True:
if touch1.value:
...
else:
....
There's nothing wrong with your code that would make it not work with a battery pack. I'd suspect an issue with the pack: it may simply need to be charged more.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
Thanks for your reply.
It still doesn't work with batterypack, and I have tried changing to new batteries.
I have made a video about the paticular problem, from uploading the firmware to making the program
https://www.youtube.com/watch?v=mfU2VfoMNnw
I hope you can help (:
It still doesn't work with batterypack, and I have tried changing to new batteries.
I have made a video about the paticular problem, from uploading the firmware to making the program
https://www.youtube.com/watch?v=mfU2VfoMNnw
I hope you can help (:
- danhalbert
- Posts: 4652
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Circuit playground express code
Ah, maybe I was wrong about running with the battery pack only. Remove the print() statement and try again with the battery pack. It may be trying to print and hanging because there's nowhere to print to.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
Hm, it doesn't do any difference to remove the print statement.
Can it be a problem that it is a while True loop?
To get the program running, it has to be connected to putty (ssh) and set in auto-reload.
If that isn't done, then it won't work. So it has to be connected with putty.
Even if you connect the board to the laptop without connecting to putty, the neopixels just light up red (from the else: statement)
but it's not reacting to touchpad A0.
Can it be a problem that it is a while True loop?
To get the program running, it has to be connected to putty (ssh) and set in auto-reload.
If that isn't done, then it won't work. So it has to be connected with putty.
Even if you connect the board to the laptop without connecting to putty, the neopixels just light up red (from the else: statement)
but it's not reacting to touchpad A0.
- jerryn
- Posts: 1868
- Joined: Sat Sep 14, 2013 9:05 am
Re: Circuit playground express code
Just a guess, but coouldit be that the Touch sensitivity is different for the battery connected case than for the USB connected case. You could try adding a wire to the touchpad or better some conductive surface like copper tape attached to the pad.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
I have tried another program, which is a fidget spinner, made by Tony Dicola and Tannewt from adafruit.
https://github.com/adafruit/Adafruit_Ci ... spinner.py
That fidget spinner program works fine with batterypack, so there must be some bug with my own program?? (:
https://github.com/adafruit/Adafruit_Ci ... spinner.py
That fidget spinner program works fine with batterypack, so there must be some bug with my own program?? (:
- jerryn
- Posts: 1868
- Joined: Sat Sep 14, 2013 9:05 am
Re: Circuit playground express code
Not necessarily, the fidget spinner does not use the touchio code. I still wonder if there is a difference. I can test this tonight or tomorrow when I get home with my CPX. (i'm on bus now ;-)
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
Jerry:
That would be nice (:
That code I use, is the one I posted before. (on the picture).
except the print statement (A0 touched!) which I deleted, because I wanted to connect it to a batterypack.
That would be nice (:
That code I use, is the one I posted before. (on the picture).
except the print statement (A0 touched!) which I deleted, because I wanted to connect it to a batterypack.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
And I have the lastest uf2 firmware and circuitpython bundle from github, which is updated a couple of days ago.
- jerryn
- Posts: 1868
- Joined: Sat Sep 14, 2013 9:05 am
Re: Circuit playground express code
I'll try to reproduce your setup and see how mine responds. What battery are you using? If I can reproduce your situation, I can then see if I can create something that works. It probably won't be until tomorrow morning (EDT) though.
- danhalbert
- Posts: 4652
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Circuit playground express code
I just tried this with a LiPo battery and it worked, though A0 seemed a little flakier than A1. I also couldn't just touch the edge: I had to touch the whole ring of the hole, sometimes a little firmly.
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
Jerryn:
I use 3 X AA batteries (:
I use 3 X AA batteries (:
- rasfh
- Posts: 15
- Joined: Mon Aug 28, 2017 5:07 am
Re: Circuit playground express code
Danhalbert:
Sounds odd, since I can only get it to work, with a laptop, and then connected to the board by putty (ssh)
Sounds odd, since I can only get it to work, with a laptop, and then connected to the board by putty (ssh)
Please be positive and constructive with your questions and comments.