Notifications
Clear all

Newbie needs help with arduino code

108 Posts
5 Users
1 Likes
31.8 K Views
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  

ok let me try that last ino you sent

 


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  
Posted by: @pugwash

I have reactivated all the "if" statements, "switch case" was not doing what I wanted it to do, but I have left the single function in this version.

 

now im getting this error

Capture

   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  

I think maybe us trying to compile on two different computers might be causing problems, just a thought.


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@chip

I think maybe us trying to compile on two different computers might be causing problems, just a thought.

Can you copy and paste the entire contents of the error window into a post. All the stuff with a black background. I can't see anything from the screen capture!


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  
Posted by: @pugwash

Can you copy and paste the entire contents of the error window into a post. All the stuff with a black background. I can't see anything from the screen capture!


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  

I think i see the problem when i downloaded your ino files i just renamed my code and left it in the same directory


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  
Posted by: @pugwash

Can you copy and paste the entire contents of the error window into a post. All the stuff with a black background. I can't see anything from the screen capture!

that was the problem i didnt realize i couldnt leave the old files in the same directory even if i renamed them

sorry for my mistake, it compiled correctly once i moved them

This post was modified 5 years ago by Chip

   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@chip

Does it compile properly now?


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  
Posted by: @pugwash

Does it compile properly now?

YES !!!! Thank you soooo much for ALL your help.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 
Posted by: @pugwash

I can't see anything from the screen capture!

right click image
Open link in new window
or
Open link in new tab

 


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@casey

I can see the image quite clearly! But unfortunately, no amount of right-clicking will make the error messages reveal themselves.

 


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@chip

Glad to see it is up and working but all those "if" statements are still bugging me!

I am sure there is a  better way of doing that, just need to put my thinking cap on for a couple of days! ? 


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  

Anyone willing to take a look at my code and offer suggestions? My RPM on my motors should be around 10 however they are reading about 2. Another issue is at random my compass reading will go to zero and I have not been able to figure out why.

IMG 1074

 

This post was modified 4 years ago 2 times by Chip

   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

Hi @chip

This looks like a 2 RPM target, not 10 RPM ? 

 if (rpmR < 2) {
GOMR++;
}
if (rpmL < 2) {
GOML++;
}
if (rpmR > 2) {
GOMR--;
}
if (rpmL > 2) {
GOML--;
}

Eric


   
ReplyQuote
Chip
 Chip
(@chip)
Member
Joined: 5 years ago
Posts: 79
Topic starter  
Posted by: @zeferby

This looks like a 2 RPM target, not 10 RPM ? 

Yes you are correct although my wheels are actually spinning around 10 RPM and I have to set the target of 2 in my code to get them to spin 10 RPM, if I set it to 10 here the wheels are spinning much faster than 10 RPM.

This is what I can not figure out and I am using the code Bill posted on the Dronebot Workshop for DB1 and I am using the same exact motors with encoders he is using. When the motors are spinning at 10 RPM my code is showing 2 RPM.


   
ReplyQuote
Page 2 / 8