Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
pboachie

Wireless receiver response problems

Question

Hello there. I made a small little code that would turn on and off a wireless reciever from WR-CBE Logic. It used to work and then it just stopped. Is there something missing?

local term = require("term")
local component = require("component")
local rs = component.redstone

print("Enter Freq")
term.write("Freq: ")
x1 = io.read()
freq = tonumber(x1)

rs.setWirelessFrequency(freq)
rs.setWirelessOutput(true)
os.sleep(3)
rs.setWirelessOutput(false)
Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi pBoachie,

 

I've not tried this yet, but if you give me your basic setup (a screen shot of how you've got things connected) I will take a look as it's something I'll be doing eventually any way.

 

So may as well take a stab at it now  :)

Link to post
Share on other sites
  • 0

OK done some testing (OC 1.5.6), nothing wrong with your program but two things I learned from this:

 

Firstly, don't call your Lua script "redstone" it won't work and will give you instructions for using OC's redstone API  :P (ended up calling mine testRed.lua)

 

Secondly, frequency 0 doesn't work, but anything else appears to be fine. The "os.sleep(int)" command needs to be longer as the computer isn't guaranteed to be processed at fixed intervals which can lengthen or shorten the live period. I set it to 5 and, baring Frequency 0, never had an issue.

 

You must have a Redstone Tier 2 card installed in the computer and you don't need a wireless transmitter (the tier 2 card is this item in effect). A Redstone I/O block doesn't work.

Link to post
Share on other sites
  • 0
Firstly, don't call your Lua script "redstone" it won't work

 

FYI, you can still call it that, but then you'll have to run it via ./redstone.lua (i.e. with the leading relative or absolute path), otherwise OpenOS will always try to resolve that name using the PATH env variable, first, leading it to use the built-in program called like that.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.