Skip to content

andyguenin/Robockey

Repository files navigation

This code is for the MEAM510 robockey project using an ATmega32u4 processor

In your main c file, you only need to include the "common_robockey.h" header file

You must create a file called bot.h and in it, define your robots name in capital letters (grinder, sniper, goalie),
and set the define vaule according to the following table:

GRINDER -> 0x25
SNIPER ->  0x24
GOALIE  -> 0x26
	
	
	
In your main method, before doing anything else, call the init_all() fuction

You will be given access to the following functions and variables:

	**
	void init_all()
	
	Initializes everything.  Your project must have the m_bus and m_rf in it
		
	
	**
	You should use the higher-level go_to(x, y, t, s) function instead of the following if possible
	
	void set_left(int)
	void set_right(int)
	
	These functions will set the left and right wheels, assuming you have the following pins assigned
	to the following actions and are using the motor driver I made:
	
	Lenable: B5
	Ldirection: C6 (high -> forward, low -> backward)
	Renable: B6
	Rdirection: C7 (high -> forward, low -> backward)
	
	
	**
	wait(int)
	
	Pauses execution for int seconds (does not affect the movement of the motors. Usefull for debugging)
	
	
	**
	bool wireless_buffer_full()
	
	True if the wireless buffer has changed.  Calling get_wireless_buffer(void) will set the value
	returned by this function to false
	
	
	**
	
	char* get_wireless_buffer(void)
	
	Returns a pointer to a character (or the first element of a character array) of length PACKET_SIZE
	
	**
	
	void set_position(int x, int y)
	
	sets the 0,0 position.  required for position determination
	
	**
	
	void get_position(unsigned int*, double*)
	
	sets the double* to a three element array containing {x, y, theta} given the direct output of the wii sensor into unsigned int*
	
	**
	
	
	

About

Robockey for MEAM 510 at the University of Pennsylvania

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages