Unleashed 1.1.3 Open Peripherals

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
I'm wondering if anyone can help. I'm trying to build a computer/monitor set up to display the current temperature of a Steam Boiler, and I know that OpenP Should be able to do this, but I'm not sure how I figure out what I need to read off the boiler. Anyone more experienced know what I need?

Computer has it's back to the boiler and a monitor on the left (two wide, one high). Thanks for any help.
 

angelnc

New Member
Jul 29, 2019
232
0
0
To wrap the boiler:
Code:
boiler = peripheral.wrap("back")

To wrap the monitor:
Code:
monitor = peripheral.wrap("left")

To get the boiler temperature:
Code:
temperature = boiler.getTemperature()

To print the temperature on you're screen:
Code:
monitor.setCursorPos(1,1)
monitor.write(temperature)

Those are the basic functions you need for you're program.
Go and try it out =)
 
  • Like
Reactions: KingTriaxx

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
Everything works except boiler.getTemperature() it returns Attempt to call nil.

Also, thanks for the help.
 

angelnc

New Member
Jul 29, 2019
232
0
0
Did you put it next to the firebox?
The getTemperature method only works for the firebox.

Maybe post your code so I can see what's wrong.
 
  • Like
Reactions: KingTriaxx

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
No, I had it set up against the tank. Thanks for that.

Other than restarting, how do I make it update the temp every minute or so?
 

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
Code:
boiler = peripheral.wrap("back")
monitor = peripheral.wrap("left")
 
while true do
temperature = boiler.getTemperature()
 
monitor.setCursorPosition(1,1)
monitor.write("Temp")
monitor.setCursorPosition(1,2)
monitor.write(temperature)
sleep(1)
end

Which shows the temperature, but doesn't seem to update.
 

CascadingDragon

New Member
Jul 29, 2019
114
0
0
Something like this should work for you. Keep in mind I haven't tested this.

Code:
boilderSide = "back" # change this
monSide = "left"
 
boiler = peripheral.wrap(boilerSide)
monitor = peripheral.wrap(monSide)
 
function writeTemp()
  monitor.clear()
  monitor.setCursorPos(1,1)
  monitor.write("Tempature is")
  monitor.setCursorPos(1,2)
  temp = boiler.getTemperature()
  monitor.write(temp)
end
 
while true do
  writeTemp()
  sleep(60)
end
 
  • Like
Reactions: KingTriaxx

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
I did, then had to break it to get to the computer to break it because I couldn't terminate the program. It's working now, Thanks guys!
 

KingTriaxx

Forum Addict
Jul 27, 2013
4,266
1,333
184
Michigan
I tried that, but for some reason it was not responding the way it should. So I had to break it to get it to listen to the command.