catdogmouse tvout draft
parent
90939591a6
commit
4b1397dd9e
@ -0,0 +1,108 @@
|
||||
#include <TVout.h>
|
||||
#include <fontALL.h>
|
||||
|
||||
TVout TV;
|
||||
unsigned char x,y;
|
||||
|
||||
int toggle_3;
|
||||
int toggle_2;
|
||||
int toggle_1;
|
||||
|
||||
char poetry;
|
||||
char animal1[] = " cat";
|
||||
char animal2[] = " dog";
|
||||
char animal3[] = " mouse";
|
||||
char animal4[]= " cockroach";
|
||||
|
||||
char str[] = "hello";
|
||||
char str2[] = "CAT";
|
||||
char str3[] = "BARK";
|
||||
String str4 = "booomaaar";
|
||||
|
||||
const byte NUMBER_OF_NAMES = 7;
|
||||
char *names[NUMBER_OF_NAMES] = {
|
||||
"BOB0",
|
||||
"BOB1",
|
||||
"BOB2",
|
||||
"BOB3 ",
|
||||
"BOB4",};
|
||||
|
||||
const byte greet = 4;
|
||||
char *greets[greet] = {
|
||||
" Hello ",
|
||||
" Hi ",
|
||||
" hey ",
|
||||
" ayyy ",};
|
||||
|
||||
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
x=0;
|
||||
y=0;
|
||||
TV.begin(_NTSC,128,96);
|
||||
TV.select_font(font4x6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
toggle_2 = analogRead(2);
|
||||
if (toggle_2 < 250) {
|
||||
TV.println(animal1); //print cat
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_2 >250 && toggle_2 <350){
|
||||
TV.println(animal2); //print dog
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_2 >350 && toggle_2 <500){
|
||||
TV.println(animal2); //print dog 2
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_2 >500 && toggle_2 <750){
|
||||
TV.println(animal3); //print mouse
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_2 >750){
|
||||
TV.println(animal4); //print cockroach
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
|
||||
delay(200);
|
||||
|
||||
|
||||
toggle_1 = analogRead(1);
|
||||
if (toggle_1 < 250) {
|
||||
TV.println(&str[4]); //prints "o"
|
||||
TV.println(&str[3]);// prints "lo"
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_1 >250 && toggle_1 <500){
|
||||
TV.print(&str[3]); //prints "lo"
|
||||
TV.print(&str2[1]); // prints "AT"
|
||||
TV.delay(100);
|
||||
TV.print(&str3[3]); //prints "K"
|
||||
TV.print(&str3[0]); // prints "AT"
|
||||
}
|
||||
|
||||
else if(toggle_1 >500 && toggle_1 <750){
|
||||
TV.println(&str[0]); // prints "hello"
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
else if(toggle_1 >750){
|
||||
TV.print(str[2]); // prints "llo"
|
||||
TV.print(str2[0]); // prints "CAT"
|
||||
TV.delay(100);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
#ifndef FONTALL_H
|
||||
#define FONTALL_H
|
||||
|
||||
#include "TVoutfonts/font4x6.h"
|
||||
#include "TVoutfonts/font6x8.h"
|
||||
#include "TVoutfonts/font8x8.h"
|
||||
#include "TVoutfonts/font8x8ext.h"
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue