ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

PRO
Canada
#1  

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

  1. Add the EZ-B Connections Skill: Ensure you have added the EZ-B Connections skill to your ARC project.
  2. Configure the Connection: In the EZ-B Connections skill, add a new connection and set it to connection number 3. Enter the IP address or COM port of your EZ-B IoTiny.

Step 2: Add the PWM Slider Skill

  1. Add the PWM Slider Skill: Ensure you have added the PWM Slider skill to your ARC project.
  2. Configure the PWM Slider: In the PWM Slider skill settings, select the digital port to which your LED is connected and set the board number to 3 (since you are using connection number 3).

Step 3: Add the Set Digital Skill

  1. Add the Set Digital Skill: Ensure you have added the Set Digital skill to your ARC project.
  2. Configure the Set Digital Skill: In the Set Digital skill settings, select the digital port to which your LED is connected and set the board number to 3.

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:

// Set the PWM value for the LED on connection 3, digital port D0
var pwmValue = 128; // Example PWM value (0-255)
PWM.set(D0, pwmValue, 3); // Set PWM on port D0 of connection 3

// Set the digital port D1 to high (turn on the LED)
Digital.set(D1, true, 3); // Set digital port D1 to high on connection 3

// Set the digital port D2 to low (turn off the LED)
Digital.set(D2, false, 3); // Set digital port D2 to low on connection 3

Explanation:

  • PWM.set(D0, pwmValue, 3): This command sets the PWM value on digital port D0 of connection 3.
  • Digital.set(D1, true, 3): This command sets digital port D1 to high (turns on the LED) on connection 3.
  • Digital.set(D2, false, 3): This command sets digital port D2 to low (turns off the LED) on connection 3.

Step 5: Execute the Script

  1. Add the Script to Your Project: Add the script to your ARC project by creating a new script control.
  2. Run the Script: Execute the script to control your LEDs.

Additional Tips:

  • Check Connections: Ensure that your EZ-B IoTiny is correctly connected and that the IP address or COM port is correctly configured in the EZ-B Connections skill.
  • Test Individual Components: Before running the full script, test each component (PWM Slider and Set Digital) individually to ensure they are working correctly.

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.
PRO
Belgium
#2  

@athena

if i use this PWM.set(D0, pwmValue, 3) its says missing string or wrong values ?

PRO
Canada
#3  

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:

  1. The port (as a string, e.g., "D0").
  2. The duty cycle percentage (as a number between 0 and 100).
  3. The optional EZ-B index (if you have multiple EZ-Bs connected).

Here's the corrected example script in JavaScript:

// Set the PWM value for the LED on connection 3, digital port D0
var pwmValue = 50; // Example PWM value (0-100)
PWM.set("D0", pwmValue, 3); // Set PWM on port D0 of connection 3

// Set the digital port D1 to high (turn on the LED)
Digital.set("D1", true, 3); // Set digital port D1 to high on connection 3

// Set the digital port D2 to low (turn off the LED)
Digital.set("D2", false, 3); // Set digital port D2 to low on connection 3

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:

  • Ensure that the port names are correctly specified as strings (e.g., "D0", "D1", "D2").
  • The PWM value should be between 0 and 100, representing the duty cycle percentage.
  • The EZ-B index (3 in this case) should match the connection number you are using.

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.
PRO
Belgium
#4  

@athena

the problem is allreddy in the first line . what are the missing string and invalid expression ?

Error on line 1: Missing String Quotes or Invalid Expression at index 0: PWM.set(D

PRO
Belgium
#5  

@athena

i'm using ez script . can this be the problem ?

PRO
Canada
#6  

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

# Set the PWM value for the LED on connection 3, digital port D0
PWM(D0, 50) # Example PWM value (0-100)

# Set the digital port D1 to high (turn on the LED)
Set(D1, ON)

# Set the digital port D2 to low (turn off the LED)
Set(D2, OFF)

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:

  • Ensure that the port names are correctly specified (e.g., D0, D1, D2).
  • The PWM value should be between 0 and 100, representing the duty cycle percentage.

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.
PRO
Belgium
#7  

@athena

were do i specifie the conection 3 in here ? pwm(d0,100)

PRO
Canada
#8  

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

# Specify the connection index (board index)
BoardIndex(3)

# Set the PWM value for the LED on connection 3, digital port D0
PWM(D0, 100)  # Example PWM value (0-100)

# Set the digital port D1 to high (turn on the LED)
Set(D1, ON)

# Set the digital port D2 to low (turn off the LED)
Set(D2, OFF)

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.
PRO
Belgium
#9  

@athena

were in the line do i specifie BoardIndex ?

PRO
Canada
#10  

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 the BoardIndex command in your script:

Example Script in EZ-Script

# Specify the connection index (board index)
BoardIndex(3)

# Set the PWM value for the LED on connection 3, digital port D0
PWM(D0, 100)  # Example PWM value (0-100)

# Set the digital port D1 to high (turn on the LED)
Set(D1, ON)

# Set the digital port D2 to low (turn off the LED)
Set(D2, OFF)

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 the BoardIndex 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.
#11   — Edited

@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.

PRO
Belgium
#12  

#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)

#13   — Edited

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.

PRO
Belgium
#14  

@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

#15   — Edited

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

PRO
Belgium
#16  

@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 .:)

User-inserted image

sorry for late respons . i dont have sounds in my telenet mailbox .

#17   — Edited

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.

PRO
Belgium
#18  

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 .

#19  

Quote:

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 .
I'm not sure why you used all your internet data this month. I don't think it would have anything to do with your EZB's connecting to your laptop and ARC. I don't know how it works over in Belgium but here in the USA WIFI connections from one device (like a laptop) to another device (like the EZB's connecting to ARC) that run through your router are not metered by my internet provider. That means my internet provider does not charge me or keep track of wifi connections that stay in my home. However connections that reach out into the internet like watching Netflix, listening to streaming music and browsing the WWW do go out into the wild and are metered and charged against my data plan by my internet provider. As far as ARC going out and using the internet, that depends on what skills you are using. Skills like Bing Speech Recognition do reach out into the internet to work. Also if you have the setting turned on in the options menu, ARC will report your usage to Synthiam for Diagnostics purposes.

@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.

PRO
Canada
#20  

Certainly! Here is a list of some ARC skills that rely on an internet connection to work:

Skills That Rely on Internet Connection:

  1. Bing Speech Recognition: Uses Microsoft's Bing Speech API to convert spoken language into text.
  2. Cognitive Services: Includes various skills like Emotion Detection, Face Recognition, and more, which use cloud-based AI services.
  3. OpenAI GPT-3: Uses OpenAI's API to generate human-like text based on prompts.
  4. Weather: Fetches weather data from online services.
  5. RSS Feed Reader: Reads RSS feeds from the internet.
  6. Twitter: Posts tweets and reads Twitter feeds.
  7. Google Calendar: Integrates with Google Calendar to fetch and manage events.
  8. IFTTT: Uses the IFTTT service to trigger actions based on various conditions.
  9. Email: Sends and receives emails.
  10. Web Browser: Opens and interacts with web pages.

Data-Intensive Skills:

  1. OpenAI GPT-3: This can be quite data-intensive due to the large amount of data processed and returned by the API.
  2. Cognitive Services: Skills like Emotion Detection and Face Recognition can use significant data, especially if processing high-resolution images or video streams.
  3. Bing Speech Recognition: Continuous speech recognition can consume a fair amount of data, especially if used frequently.
  4. Weather: While not extremely data-intensive, frequent updates can add up.
  5. Twitter: Fetching and posting tweets can use data, especially if done frequently.
  6. Email: Sending and receiving large attachments can consume significant data.
  7. Web Browser: Depending on the websites visited, this can be very data-intensive.

Tips to Manage Data Usage:

  1. Limit Usage: Use data-intensive skills sparingly and only when necessary.
  2. Local Alternatives: Use local alternatives where possible. For example, use local speech recognition instead of cloud-based services.
  3. Monitor Data: Keep an eye on your data usage through your internet provider's dashboard.
  4. Optimize Settings: Adjust settings in ARC to reduce data usage, such as lowering the frequency of updates for weather or RSS feeds.

Example of Adjusting Settings:

  • Bing Speech Recognition: You can limit the duration and frequency of speech recognition sessions.
  • Weather: Set the update interval to a longer duration to reduce the number of requests.

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.
PRO
Belgium
#21  

@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 .