Skip to content

And I’m back: Carbot Shield and Software PWM IV

October 8, 2014

I’m back to working on the carbot shield. I’ve got the headers and the odd passive done on the top side. The power circuit is complete and the inputs to the motor driver are done. It’s actually a lot more work than using a solderless breadboard and jumpers but hopefully it will be solid and respectable looking.

14-10-08 top
14-10-08 bottom

I’m working on the pwm software at the same time starting with header files for the connections and routines.

//softpwm.h defines for olduino software pulse width management.
unsigned int step=0;
unsigned char toggle[8]={0,0,0,0,0,0,0,0}; //toggle table for software pwm
unsigned char dct[2]={0,0}; //duty cycle table for pwm bits
void analogWrite(unsigned int bit, unsigned int val);
void pwmstep();	//run one step of the software pwm cycle
void pwmcycleN(unsigned int howmany); //run howmany*8 steps of the software pwm

//carbot.h defines for the carbot wall follower
#define pwma 1	//pwm for $a side
#define pwmb 0	//pwm for $b side
#define bin1 3	//front motor pole for $b
#define bin2 2	//back
#define ain1 4	//front motor pole for $a side
#define ain2 5	//back
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: