Asked — Edited

Rgb Led Help Needed

Hi everyone, im having a great deal of trouble trying to sync 2 of the RGB leds i have for my robots eyes.

Just spent the last 2hrs, and some other days trying to get them to sync, so i thought it best i turn the ezb off and ask for assistance because its greatly delaying my current project...and meanwhile giving me zero confidence to start the next project for if i can't sync 2 leds... tired

Ive been close with it, but then they stray off and start to do their own thing, no matter what i do i just can't get them to join in holy matrimony.

Any help would be greatly appreciated, ive spent around 3-4 hrs total trying to figure it out as embarrassing as it is for me to say..and the more i try it seems to all go backwards and becomes much worse than when i started.


ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

#49  

Just to clarify, the script in post #18 is the one you should try, and it is specific for a common anode LED's which we think is what you have. It won't work for common cathode LED's, and in fact, seeing nothing but blue may be exactly what you would get from that (again, I don't have any to play with, but it kind of fits the symptom), thus my suggestion of testing the ports directly with controls before trying to script.

The code in post #15 is not a script, it is a listing of the individual relevant script commands. Trying to run that will absolutely not work.

Alan

#50  

@CochranRobotics,

thanks so much. Im very hard on myself, and not being able to do what i wanted really deflated me for ive seen others robots with their rgb eyes perfectly in sync here.

Ive been working on many other things, building a humanoid for the first time is actually quite a task, well i wouldn't call building a robot a task, its too much fun to call it that..but that programming yes what a task...but i built it from scratch and it has been a blast to build, but very time consuming, you build it, strip it down, mock things up, remove, cut, trim, trial and error...i love all that, but having trouble programming something you want so badly to come to life, and spending hours trying and not getting anywhere is deflating...but i have to remember i only joined here 2 months ago...i think im expecting way too much way too soon...you guys agree..?

:)

#51  

@TTG,

ah i see....omg no wonder it wasn't working...hehe.

Im going to have my humanoid finished by this weekend, so will start a Robi thread next week and will be asking for assistance for that, thanks very much again for your help TTG.

#52  

Programming is simply a different mindset than building. I am a better programmer than builder, so I have been focusing on Building more than programming lately. I enjoy the building because it is on the fringe of my knowledge. Programming is understood so it becomes boring for me most of the time. I could get better at it for sure, but the building is setting there waiting for my attention.

It is easy to see results when building. It is not as easy to see results when programming so it feels like you slow down. Believe me when I say that you have the right platform for programming your robot. It just takes time to understand how to script things together properly.

Copying and pasting code is probably the best way to stay unfamiliar with programming. I tell my guys this all of the time. It is better to take the time to type out the code and try to understand what is going on while you are typing it. This will get you more familiar with the language much more quickly than copying and pasting it. Copy/paste is a quick solution to a problem, but it isn't the right solution to the problem, and often times isn't the correct solution to the problem.

Start with something familiar, learn the syntax and then push yourself to learn more. Its a process, but definitely doable.

#53  

Quote:

you guys agree..?

Yup... I have been here 4 years, and am still mostly playing with Revolution bots. I have grand plans to make a robot steampunk dog from scratch, but every time I think I am ready to start, I see someone do something new and incredible here and rethink all of my plans. However, that means I have been able to spend a lot of time learning the programming and scripting, which is my core competency, while I slowly learn the construction and electronics, neither of which I have much experience in.

For instance, when I started, I could barely solder two wires together, I have now added a laser diode to my Roli's camera, which required both a 5v regulator and a transistor since it needed higher voltage, and higher amperage than the EZ-B digital port could provide, but lower voltage than the 7.4 v LiPo powering the robot. I used a combination of different posts and tutorials here to figure out how to build and program it.

Start things in little steps to understand how each part works, then take on the big task. Like with your RGB LED. Figure out how to get one to light in every color and how to control the brightness, then building a script to coordinate two of them together will be easy because you will understand what every line of the script does, and when it needs to execute.

Alan

#54  

@CochranRobotics,

100% agree with that, i use Linux and teached myself terminal commands which i like to use time to time, i type them out from memory now...if i could do that with programming that would be fantastic.

When you said i have the right platform for programming your robot...do you mean the Blockly interface, ARC?

@TTG,

yes i keep telling myself baby steps, but forget all too easily it seems. :P

Thanks for your help, im not going to showcase my first project, but for Robi i will and will ask for help then. At least for now i have one led(red) for an eye....i can control the brightness of it, thats something at least...oh my.:)

#55  

ARC in General. Here is why I say this. There is a level of progression that you can benefit from.

Scratch Blocky Scripting Plugins

I know of no other platform that allows you to start from no knowledge of programming through some advanced programming. At first, there was only scripting. Those who have been around here a long time prefer to use scripting because that is what we learned with. Now, you can be eased into Scripting, but for those programmers out there, you can make ARC into anything you want it to be by the use of plugins.

PRO
USA
#56  

I been on and off with conference calls...

David, Thanks for the kind words, although i don't have:


lock(this)
{
  while (!isSolved)
  {
    DoSomething()
  }
}

in other words i don't own an exclusive lock for this thread:) So feel free to jump in, correct me or suggest other ideas:) sometimes i fail to identify very simple details, and i always go for inner details:)

Alan's suggestions are good, instead of jumping to script you can try:

  1. ON/OFF control to identify the led color legs
  2. Once you know the leg color, wire them in a logic way, e.g. RGB (Red,Green,Blue) to ports D0,D1,D2. (is easy to remember a sequence) also combine the cable colors.

For example, i try to keep red and black for power, and blend colors (white,yellow,grey) for input signals and strong colors (brown, blue, green, purple) for output signals, that way i know easily connecting two strong colors (two outputs) can cause a short-circuit.

So colors, sequences, etc help you to remember.

  1. with 3 on/off controls you can toggle 7 (2^3 -1) different combinations/colors
  2. add 3 pwm slider controls one for each port, now you can control the color brightness, now you will have more colors.

if everything is good, start with the second RGB led.

Scripting is a different thing, try first the visual tools (Blocky), to visualize control flow, individual actions etc.

Only then you should start with the EZ-Script tutorials.