This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sam's profile picture

[Question] Coding RP sensors

Started by Sam, 04 September 2012 - 10:59 PM
Sam #1
Posted 05 September 2012 - 12:59 AM
I need to code it, but I'm not sure how to tell the sensor what to do?
you can just use the code:


local function loop(delay)
while true do
local sides={'left','back','right','front'}
for i=1,4 do
rs.setOutput(sides[i],true)
sleep(delay)
rs.setOutput(sides[i],false)
end
end
end

Then you call the function with the delay (in seconds) between each light change eg:


loop(0.25)

give it a try
How do I code this in? I have transmitter chips and an RP2 chip in my sensor, it's already registered, how do I input the code?
Mmmmmmmm #2
Posted 05 September 2012 - 10:11 AM
Open a computer -> Type "edit startup" -> Enter code -> I'm not going to do the "??? PROFIT" thing.

You really could've just found out how to do this yourself easily…
KaoS #3
Posted 05 September 2012 - 10:36 AM
This is not anything to do with RP2, the entire point is to not use the RP2 items here, this is for CC