Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Code not loading with battery pack?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Code not loading with battery pack?

by aabeshde on Fri Mar 20, 2020 3:14 pm

Hi everyone, I tried looking around everywhere but couldn't find a solution for this...I'm running the basic code for the Soil Sensor project (code below), and it's loading fine via the USB cable. However, when I use the battery pack, all I get is constantly flashing red light along with a green light by the power outlet. The battery works, but I'm not sure the code is loading properly. I made sure to load up the appropriate libraries in boot folder as well. Any ideas?

Code: Select all | TOGGLE FULL SIZE
import time
from adafruit_circuitplayground.express import cpx
import touchio
import simpleio
import board

cpx.pixels.brightness = 0.2
touch = touchio.TouchIn(board.A1)

DRY_VALUE = 2500
WET_VALUE = 3500

while True:
    value_A1 = touch.raw_value
    print((value_A1,))

    # fill the pixels from red to green based on soil moisture
    percent_wet = int(simpleio.map_range(value_A1, DRY_VALUE, WET_VALUE, 0, 100))
    cpx.pixels.fill((100-percent_wet, percent_wet, 0))
    time.sleep(0.5)

aabeshde
 
Posts: 6
Joined: Fri Mar 20, 2020 3:05 pm

Re: Code not loading with battery pack?

by adafruit_support_carter on Thu May 28, 2020 12:21 pm

What filename are you saving the code as?

adafruit_support_carter
 
Posts: 16902
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.