Codey.face does not display generated face


#1

This program works fine

import codey

codey.face(
    '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
    '0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0'
    '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0')

But this program shows empty face:

import codey

def ff():
   return ('0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
    '0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0'
    '0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0'
    '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0')

codey.face(ff())

The output of the function seems to be ok (at least it is printed fine if I replace codey.face with codey.show).

I’m trying to display the face generated by the function and sometimes I get empty screen, for some values I get some image but not the one that I feed into face function.

What can be a problem? Is there a workaround?


#2

Let me correct it. Codey.face is the old API which is not working any more.
For your case, please download and install the latest mBlock 5: RC version.. Then update firmware for Codey Rocky.
And this is updated API guides link: https://makeblock-micropython-api.readthedocs.io/en/latest/codey&rocky/codey/index.html, please follow it to write your own codes.


#3

I don’t quite understand. Does it matter where the string comes from? If it is declared static or if it is returned from the function? Do you want to say that it is expected that string returned from the function cannot be passed to codey.face?


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.