Asked
— Edited
Resolved by Dave Schulpius!
i'm using connection number 3 whit 3 pwm's for controling LeD's . i'm using a script to controle the LED'S . how do i ad a connection to my script ? how does my script know whits iotiny i use ?
Related Hardware EZ-B IoTiny
To control LEDs using PWM on connection number 3 with your EZ-B IoTiny, you need to ensure that your script correctly references the specific connection. Here's a step-by-step guide to help you set up and control your LEDs using a script in ARC:
Step 1: Add the EZ-B Connections Skill
Step 2: Add the PWM Slider Skill
Step 3: Add the Set Digital Skill
Step 4: Write the Script
Now, you need to write a script to control the LEDs using the PWM Slider and Set Digital skills. Here’s an example script in JavaScript:
Explanation:
Step 5: Execute the Script
Additional Tips:
By following these steps, you should be able to control your LEDs using PWM and digital signals on connection number 3 with your EZ-B IoTiny. If you have any further questions or run into issues, feel free to ask!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@athena
if i use this PWM.set(D0, pwmValue, 3) its says missing string or wrong values ?
It looks like there might be a syntax issue or a misunderstanding of the parameters for the
PWM.set
function. Let's correct that and ensure you have the right syntax.The
PWM.set
function in ARC requires the following parameters:Here's the corrected example script in JavaScript:
Explanation:
PWM.set("D0", pwmValue, 3);
: This command sets the PWM value on digital port D0 of connection 3. The port is specified as a string ("D0"), and the PWM value is a number between 0 and 100.Digital.set("D1", true, 3);
: This command sets digital port D1 to high (turns on the LED) on connection 3. The port is specified as a string ("D1").Digital.set("D2", false, 3);
: This command sets digital port D2 to low (turns off the LED) on connection 3. The port is specified as a string ("D2").Additional Tips:
By using the corrected syntax, you should be able to control your LEDs using PWM and digital signals on connection number 3 with your EZ-B IoTiny. If you encounter any further issues, please let me know!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@athena
the problem is allreddy in the first line . what are the missing string and invalid expression ?
@athena
i'm using ez script . can this be the problem ?
Yes, if you are using EZ-Script, the syntax will be different from JavaScript. Let's correct the script for EZ-Script.
In EZ-Script, the commands for setting PWM and digital values are different. Here is how you can do it:
Example Script in EZ-Script
Explanation:
PWM(D0, 50)
: This command sets the PWM value on digital port D0. The value is between 0 and 100.Set(D1, ON)
: This command sets digital port D1 to high (turns on the LED).Set(D2, OFF)
: This command sets digital port D2 to low (turns off the LED).Additional Tips:
By using the corrected syntax for EZ-Script, you should be able to control your LEDs using PWM and digital signals with your EZ-B IoTiny. If you encounter any further issues, please let me know!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@athena
were do i specifie the conection 3 in here ? pwm(d0,100)
In EZ-Script, you specify the connection index using the
BoardIndex
command. This command sets the active board index for subsequent commands. Here’s how you can specify connection 3 and set the PWM value for your LEDs:Example Script in EZ-Script
Explanation:
BoardIndex(3)
: This command sets the active board index to 3. All subsequent commands will be sent to the board at connection 3.PWM(D0, 100)
: This command sets the PWM value on digital port D0 to 100.Set(D1, ON)
: This command sets digital port D1 to high (turns on the LED).Set(D2, OFF)
: This command sets digital port D2 to low (turns off the LED).By using the
BoardIndex
command, you can specify which connection (board) the subsequent commands should be sent to. This way, you can control the LEDs on connection 3 with your EZ-B IoTiny.If you encounter any further issues, please let me know!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@athena
were in the line do i specifie BoardIndex ?
You can specify the
BoardIndex
at the beginning of your script or before any command that needs to be sent to a specific connection. Here is an example of how to include theBoardIndex
command in your script:Example Script in EZ-Script
Explanation:
BoardIndex(3)
: This command sets the active board index to 3. All subsequent commands will be sent to the board at connection 3.PWM(D0, 100)
: This command sets the PWM value on digital port D0 to 100.Set(D1, ON)
: This command sets digital port D1 to high (turns on the LED).Set(D2, OFF)
: This command sets digital port D2 to low (turns off the LED).By placing the
BoardIndex
command at the beginning of your script, you ensure that all subsequent commands are directed to the specified connection (in this case, connection 3). If you need to switch to a different connection later in the script, you can use theBoardIndex
command again to specify the new connection.If you have any further questions or need additional assistance, please let me know!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@Nomad, I found this in the EZ Script commandd section of the Support section here:
Multiple EZ-B Boards: ARC supports multiple physical EZ-B Boards connected to your computer.You can specify the board by putting the board number in front of the port. Forexample: Servo(2.d0, 8) will move the D0 servo on EZ-B board #2 toposition 8. If no board index is specified, the first board (zero) is assumed.If using more than one board, the first board is always responsible formovement panels. <------
So your EZ Script command for connection 3 will look something like this:
PWM(2. D0, 100)
Connection 1 is in the zero connection slot of ARC's connection skill. So your 3rd EZB is listed as 2 in your script.
#dave
thats what i tough also but it doesn work . i took a new projecht whit only the rgb an it doesn eather work . not on iotiny or ezbv does the rgb work . not even a simpel one color .
:loop sleep(200) pwm(3,d0,0) pwm(3,d1,0) pwm(3,d2,0) sleep(1000) pwm(3,d0,100) pwm(3,d1,100) pwm(3,d2,100) sleep(200) goto(loop)
If that's your script then problem is you are using commas between The board connection and the next entry. You need to use a period (.).
PWM(2. D0, 100)
Also, how many ezbs do you have on your robot? Is the iotiny The fourth one? If it's the third then you should have The number two at the beginning of your command not a three.
@dave
got it . its whithout spaces . pwm(2.d0,100) i was confused by the led and rgb . the rgb is connection 3 en the led is connection 2 i use two ezbv and two iotiny's .
thank you
Outstanding! I'm glad you were able to get your script running. Congratulations. I know that's a good feeling.
Now that I'm learning and writing JavaScript I'm getting a bit rusty on EZ Script. I wasn't aware that you couldn't have spaces in EZ Script. I thought you could and haven't been able to test that out. In JavaScript it's encouraged for readability.
If you need to find more proper EZ Script commands there are several ways. You can look through the script help on the right side in the EZ Script tool. You can also Enable Intellisense Checkbox at the top of the script skill and ARC will suggest proper commands as you type. Lastly you can look through the available list of EZ Script commands in the Support section here. You should probably consider bookmark this or print the commands out. I did. Here's the link:
All EZ Script commands
@dave
one part to print and i got the hole inmoov . the connection is not stable enough yet . my worries is the 6 volt for the big servo . i have now a iotiny in the head whit ez robot servo's . on 7 volts , no worries here . for the front low emblem iotiny also no worries here cause no servo's wil be used there . only a RGB. so that leaves only the two ezbv4 for the big servo's . all small regulators have now some 7 volts . tinkering to do here . question . is it possible that a ezbv4 or iotiny change its IP adres ? or mixed up IP's ?
cool backpanel .:)
sorry for late respons . i dont have sounds in my telenet mailbox .
Looking good! Stop having so much fun!! lol.
If your EZB and IoTiny are in Client mode then your router assigns them an IP address. As far as I know, once your router assigns the IP address the router will keep track of it and always use the same IP address unless you reset the EZB. Once reset the EZB will go into AP mode.
If your EZB or IoTiny is in AP mode they will be using it's own IP address. I think it is 192.168.1.1.23. However you will have to disconnect your computer from your home network and then connect your computer to the EZB's AP network. Start up the EZB that's in AP mode and look for a network with EZB or IoTiny in it.
Once you're connected you can go into it's web server using your internet browser and change it to client mode and let your router keep track of it. Don't forget to reconnect to your home network to set up the EZB in ARC that is now in Client mode. EZ Robot has tutorials on how to do all this. With all the robots you have made using ARC I'm sure you have done all this before. Good luck. I hope this helps.
hi dave
all controllers are in client mode . here is it 192.168.0.???. ( ? uniek number ) i use two old ezbv4's . the iotiny's are fine . i just got mail from my telenet provider . i used almost my montly internet . i'm going to pke there a little . sse if i can get a little , more and faster internet .
@Athena , I've often wondered; can you show us a list of the skills in ARC that rely on an internet connection to work? Then which of these skills would be most data intensive and be a financial and data drain on a internet provider data plan.
Certainly! Here is a list of some ARC skills that rely on an internet connection to work:
Skills That Rely on Internet Connection:
Data-Intensive Skills:
Tips to Manage Data Usage:
Example of Adjusting Settings:
If you have any specific skills in mind or need further assistance with managing data usage, feel free to ask!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@dave
here in belgium is averything expencive . i dont use my phone allot . no netflix and all that stuff . i do have allot devices .like tv , 4 phones . a destop , a laptop . and this all day long .