melody at the end of the finale
I know this is a really one-off post but I just can't think of what it's called, but I know it's a vibe. Does anyone know?
I know this is a really one-off post but I just can't think of what it's called, but I know it's a vibe. Does anyone know?
(Edit: Sorry! Forgot to delete the code screenshots, just ignore them)
Model-Raspberry Pi Zero 2W Rev 1.0
Other components - capacitive moisture sensor, mosfet relais, MCP3008 adc, water pump
It previously worked absolutely fine for months. I've rewired it completely, I've switched channels a few times. I've switched sensors. I've tried testing it when the sensor is outside of the soil. I am genuinely clueless. Rewiring it fixed it for a little bit, then it broke again. Changing the channel also worked once, but it also broke again. Specifically, it is outputting a value of 1023
Code-
import RPi.GPIO as GPIO
import datetime
import spidev
import time
spi = spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz = 1000000
def readData(channel):
adc = spi.xfer2([1,(8+channel)<<4,0)]
data = ((adc[1]&3) << 8) + adc[2]
return data
pinPump = 4
needsWaterPercent = 70
GPIO.setmode(GPIO.BCM)
GPIO.setup(pinPump,GPIO.OUT)
GPIO.output(pinPump,GPIO.LOW)
moistureRaw = readData(3)
moistureLessRaw = moistureRaw-300
moisturePercent = moistureLessRaw/3
moisturePercent = 100-moisturePercent # basically switching it from dryness percent to moisture percent
logFile = open("/home/ariatheroyal/WateringLogs.txt","a")
currentTime = datetime.datetime.now()
logFile.write(str(currentTime) + ":\n")
logFile.write("current moisture as a number" + str(moistureRaw))
logFile.write("Current moisture of blue pot: " + str(round(moisturePercent)) + "%")
logFile.write("\n")
if moisturePercent < needsWaterPercent:
time_end = time.time() + 2
while time.time() < time.end:
GPIO.output(pinPump,GPIO.HIGH)
GPIO.output(pinPump,GPIO.LOW)
logFile.write("Blue pot got watered!\n")
logFile.write("\n")
logFile.close()
GPIO.cleanup()
It's so silly looking back at how I was saving now. I saved 500 fates for c2 lauma (previously laumaless) and nefer's weapon. And then this happens. I have 290 fates left and I feel like the luckiest person in the world.