Integrated pixy into emulator. Pixy is no longer in the common/libs folder but in emulator/libs and discovery/libs

This commit is contained in:
t-moe
2015-04-03 21:42:46 +02:00
parent c570bda350
commit cab86098c5
68 changed files with 6968 additions and 19 deletions

View File

@@ -1,13 +1,15 @@
#include "app.h"
#include "tft.h"
#include "system.h"
#include "pixy.h"
#include <stdio.h>
void app_init() {
system_init();
tft_init();
pixy_init();
//only testwise
tft_clear(WHITE);
tft_draw_pixel(0,0,GREEN);
@@ -21,8 +23,23 @@ void app_init() {
}
int colorind;
const uint32_t colors [] = {0xFF0000, 0x00FF00,0x0000FF,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF,0x000000};
const int num_colors = sizeof(colors)/sizeof(uint32_t);
//app event loop
void app_process() {
/// printf("hello world\n");
pixy_service();
if(colorind==0) {
pixy_led_set_max_current(5);
}
int32_t response;
int return_value;
return_value = pixy_command("led_set", INT32(colors[colorind++]), END_OUT_ARGS, &response, END_IN_ARGS);
colorind%=num_colors;
system_delay(500);
}