Shop OBEX P1 Docs P2 Docs Learn Events
Tv_text help — Parallax Forums

Tv_text help

doverdover Posts: 9
edited 2011-06-02 13:42 in Propeller 1
I am a beginner in the C programming language, and need a little assistance with the code below, that uses the Image Craft C compiler. The video output goes to a TV, and works great, except I need a way to make the text much smaller. Is there a way I can specify the font or size of the text. I would appreciate detailed answers.
In addition, can someone supply me with the code for controlling a standard Parallax servo using the Image Craft C compiler?

I realize that the header files that I have included below, are not all necessary.


THE CODE:
 

#include "FdSerial.h"
#include <propeller.h>
#include <ping.h>
#include <stdlib.h>
#include <string.h>
#include <propeller.h>
#include <stdio.h>
#include "tv_text.h"
#include "keyboard.h"
#include <propeller.h>
#include "keyboard.h"
#include "keybd_array.h"





void main(void)
{
int ii = 85;
int jj = 0;


tvText_start(15);
// start TV




printf("I need this test to be smaller!");




}

Comments

  • BaggersBaggers Posts: 3,019
    edited 2011-04-28 04:41
    Hi Dover,
    Since you are new to Programming in C, and want smaller code for the prop, I suggest you dive into having a go at Spin! it's a great language!
    Look at the TV_Text_Demo.spin you get in the example files.
    :)
    If you need any help, call out for more!
  • doverdover Posts: 9
    edited 2011-05-10 16:05
    Sorry for the reply delay. I don't need the actual program code to be smaller, but the text displayed on the TV screen to be smaller.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-10 16:25
    Changing the font or the text size is not as simple as you might think. There are several TV text drivers written in Spin. Some of them use a ROM font that's 32x16. Some of them use a font that's included with the driver. I don't know which drivers have been translated into C for use with ImageCraft's compiler. There is a Graphics driver that manages a bitmap which is displayed with the TV driver (not TV_Text). I believe that has been translated into C. It uses scaled vector text for text display and you can change the scale factor at will. Disadvantage of the Graphics driver is that the bitmap takes a lot of memory space and normally is double buffered. You can eliminate one buffer to reduce the memory requirement. Another disadvantage is that you have to erase the bitmap to erase characters. The Graphics routines will just overlay one message on top of another if you don't erase the area first.
  • doverdover Posts: 9
    edited 2011-06-02 13:42
    Thanks for the information. I think I will try writing my program with a different interface. Anyway, can someone provide me with some C sample code to control a standard servo?
Sign In or Register to comment.